Array of strings difficulty
i'm using similar below in code (clipped arduino.cc reference page).
i'm new c , char arrays , pointers throw me.
the thing i'm doing different println function in separate function, not "loop" function. i'm guessing scope issue, i'm not sure how scope applied when comes pointers, rather arrays of pointers. i'm trying set error messages , wanted declare messages used globally. can done?
i'm new c , char arrays , pointers throw me.
the thing i'm doing different println function in separate function, not "loop" function. i'm guessing scope issue, i'm not sure how scope applied when comes pointers, rather arrays of pointers. i'm trying set error messages , wanted declare messages used globally. can done?
quote
char* mystrings[]={"this string 1", "this string 2", "this string 3",
"this string 4", "this string 5","this string 6"};
void setup(){
serial.begin(9600);
}
void loop(){
for (int = 0; < 6; i++){
serial.println(mystrings);
delay(500);
}
}
hi chipwitch
you need add index array reference in println statement, @ least.
try ...
does help?
ray
you need add index array reference in println statement, @ least.
try ...
code: [select]
for (int = 0; < 6; i++){
serial.println(mystrings[i]);
delay(500);
}
does help?
ray
Arduino Forum > Using Arduino > Programming Questions > Array of strings difficulty
arduino
Comments
Post a Comment