If I have class [5][20], how would I initialize it to have Boss, Manager, sales, ect on class[0][], class[1][] ..... respectively.
If I have class [5][20], how would I initialize it to have Boss, Manager, sales, ect on class[0][], class[1][] ..... respectively.
If you write and post some code, we can help guide you through whatever problems you are seeing.
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
http://cboard.cprogramming.com/showthread.php?t=98576
On that post I have done the input thing correctly, sorting function is bad.
Oh sorry, yes it is a character array, class is just the name of it.
From your example, it looks like a user input, I want to go ahead and initialize the string to 5 different words.
char class[5][20]={ }. What goes in the brackets?
Last edited by Fox101; 02-05-2008 at 08:52 AM.
I am a beginner. I don't know what goes into the brackets. That's why I used a temp string and loops to access each element and put the characters in them
I found what you are looking for:
http://www.learncpp.com/cpp-tutorial...sional-arrays/
Last edited by abh!shek; 02-05-2008 at 09:37 AM.