I want to compare two integer array and want to know that which is greater. I have tried logic to compare MSB of each to LSB but I am not getting exact result.
For Example.
int data[5] = '12334" and int sample[5] = "11274" are two integer array and I want to compare that which array is greater.
I want to compare two integer array and want to know that which is greater. I have tried logic to compare MSB of each to LSB but I am not getting exact result.
For Example.
int data[5] = '12334" and int sample[5] = "11274" are two integer array and I want to compare that which array is greater.
"11274" is a string literal not an integer. The initialization statements are filling part of the integer arrays with characters.
- Is this what you want?
- In which sense do you want to compare the strings?
Actually, I want to compare the setvalue and process value. If process value is higher than setvalue then I want to make one of the pin high logic. I have stored setvalue in EEPROM and process value is stored in one array. I read the setvalue from EEPROM and stored it again in another array. So I want to compare these two array and want to observe that which is higher.
Actually, I want to compare the setvalue and process value. If process value is higher than setvalue then I want to make one of the pin high logic. I have stored setvalue in EEPROM and process value is stored in one array. I read the setvalue from EEPROM and stored it again in another array. So I want to compare these two array and want to observe that which is higher.
I would expect process value and setpoints represented by simple signed or unsigned integers, neither arrays nor character strings. In case that the setpoint is given as a decimal string, it would be converted to an integer number, e.g by atoi() before comparing it with the process value.
I would expect process value and setpoints represented by simple signed or unsigned integers, neither arrays nor character strings. In case that the setpoint is given as a decimal string, it would be converted to an integer number, e.g by atoi() before comparing it with the process value.
Yes, that's helpful to indicate the possible user error. Other compilers are simply filling up the array with characters.