#define an array of strings, and using it the loop()

hi everybody, i would know if it is possible to define an array of strings in this way: #define String Days[]={"string1",.."stringN"}

I have even tried with a pointer #define String **Days[]={"string1",.."stringN"}

Then in the program I wanna print the elements usind the array index to print all of them.

the complier tell me that Days (called in the loop) is not declared in the scope

is there a way to make it work? is there a better way to do that? I thought about this kind of solution because I have supposed is the lightest, but I wasn't able to verify that..

Please HELP ME!!! thanks!!

Hi Enrico

You don't need the #define.

Try this: String Days[]={"string1","string 2", .. "stringN"};

Using Strings (with a capital "S") rather than C strings (with a small "s") can eat up memory quickly, so you need to be a little careful in how you use them.

What does the rest of your program look like?

Regards

Ray

Your macro is an attempt to redefine the String data type and that's not going to work. I'd go one step further than Hackscribble and tell you to forget about the String class and use a char array. The overhead with the String class is pretty high and brings nothing to the table that you can't do with a char array.