hello guys, I'm new in programming and today I have 2 question about string and char array. here is my first question :
suppose I had the following data (the data is in sting format) : M181997
from the data above I want to make something like this
Serial.print("GENDER : ");
Serial.println(first character of my string data);
Serial.print("AGE : ");
Serial.println(second and third character of my string data);
Serial.print(BIRTH YEAR : );
Serial.println(fourth, fifth, sixth and seventh character of my string data);
And I'm expecting something like this to be displayed on my Serial monitor :
GENDER : M
AGE : 18
BIRTH YEAR : 1997
and my second question is : how can I convert a string into an array? let's say I have string like this :
String myMessage="ARDUINOUNO"
now I want to convert it into something like this :
Incidentally, what values of i do you expect to get from
As long as the ith element of the array is not NULL, the middle clause of the for statement will evaluate to true. I don't like that structure. It looks like a mistake, even though it isn't.