here, I have saved all array names in the pointer array. I'm just testing here. no code other than this. can anyone help me to access and print the variable name here other than inside the variable. thank you
C strings have a null byte as terminator, so that a string "a" takes 2 bytes, "aa" takes 3 bytes, etc. I think it would be simpler to declare the C strings as C strings anyway, like this:
You only need to omit the number of chars in the definition: char state1[]= "GRRRGRRR";
The compiler will count the characters and create a suitable array.
I'm not sure what you really want to be printed to the serial monitor. The variable name cannot be printed. The uploaded sketch doesn't contain any variable name anymore.