Hi! I have a problem with homework. I need to create an array for each letter from a to z. I tried to do that with loop. Looks something like that.
for (char nos='a'; nos<='z'; nos++)
{
int nos[10];
}
But it doesn't work. Obviously i don't really know how to do it, so please tell me the right way. And i would also like to know to correct way to give a variable name of char/string value.
Isn't there a faster way to create a lot of arrays? Well actually I need stacks, but that doesn't really change much. I have defined stack as a class with functions push, pop, etc.
I have a txt file with some words in it, I need to put all words, that start with the same letter, in one stack(all words that start with 'a' in one stack, 'b' in next stack etc.)
So i thought I could create stack for each letter, after that i read each word as string s, and put it in the right stack like that - s[0].push(s) // s[0] would be first letter of word i have read