I'm having a problem with arrays and strings; I've tried a coupple of methods I googled and dug up from the forum but none seem to work or print out anything. I guess I'm missing out something important in handling string arrays in C and GEscript.
I've tried making the arrays
- Code: Select all
const char *cmdnames;[20]
cmdnames[0] = "Lieutenant Powell";
cmdnames[1] = "Sergeant Mason";
And
- Code: Select all
char cmdnames[20][15];
strcpy(cmdnames[0], "Lieutenant Powell";
strcpy(cmdnames[1], "Sergeant Mason";
What is a good way to store arrays/print them out later in GEscript? Also, how can I do a console-like printing output (so that it adds a newline then prints a new row of text after the previous row.)