Thanks for the reply! I've corrected the size of array to 4 (message[4]) to store the Rxxx value (forget the \r).
So i basically need to use atoi function and point the beggining of convertion to position [1], is that what int value = atoi (message + 1) do, is that right??
There is no \r
\r is "carriage return". \0 is the end of string marker.
So you have Rxxx\0 - count them... R x x x \0 - I make that 5. Not 4, nor 3. 5.
The variable "message" points to the start of the memory set aside as
5 bytes, so message+1 points to the start plus 1. It is functionally the same as using the & operator (address of) on the second element (message[1]) of the array (&message[1] is "the address of the second element (number 1 counting from 0 - 0,
1, 2, 3, 4) in the array").