-
How do I?
I defined an array of String (not string)
String dictionary{"hello", "Goodbye"....};
How do I refer to each String, i.e the word hello.
I was trying something like
word = dictionary[1];
hoping to get hello, but got the first letter 'h' only.
-
You want something like -
String dictionary [] = {"hello", "Goodbye"....};
String word = dictionary[0];
-
heres one
i duno if the last reply would work but here is what i would think would work.
you need space to store letters, and space to hold each word
char dictionary[256][10] = {"can hold 256 charecters","and 8 more words includeing this"};
but its only an idea
-
Thanks however
One thing I don't understand is, I use a seperate unit for the dictionary array. Then I declare:
#include "dictionary.h"
extern String dictionary;
String word = dictionary[1];
it only gives me the h again!
While declaring the dictionary in the same unit works fine. what am I doing wrong?
-
Try -
extern String dictionary[];
-
Maybe?
extern String dictionary[];
-
hehe, just a tad too slow...
-
you guys are the best
Popular pages
Recent additions