Multidimensional array Probelm using strings

Posted 25 April 2008 - 06:36 PM

Hi,

I need to have my program store names and department title stored in a two dimensonal array. I have it set up as a char type array using strings but it isn;t compling. I am just simply getting an initialzier string error. using bloodshed dev-c++ comlier. Any ideas?

Re: Multidimensional array Probelm using strings

You are declaring a char array that tells the computer that will be 100 characters in the first part and 90 in the second, but you are initializing strings. You'll have to choose.

Another possible solution is declaring it to be a pointer to a char [5][5] array

i am not sure what you mean that i will have to chose between declaring the array and intializing the strings. What am i doing there? and i can't use pointers for this project..it is a good idea thought. thanks for the hlp so far.

Re: Multidimensional array Probelm using strings

Posted 25 April 2008 - 10:06 PM

Alright got that pasrt working ..thanks for the help. I still have a problem though. I have to have the name and department stored in a 2-d array and the payrate stored in a 1-d array. But the progem has to print the name and department of everyone that makes more than 15 dollars an hour. I am not sure how to do this since htey are two different arrays. here is my code thus far

Re: Multidimensional array Probelm using strings

Posted 26 April 2008 - 09:42 AM

yeah turns out i can use pointers..sorry for the mistake. But yeah i know it doesn't run, it says illegal operation. It will run fine just displaying the info, it is the code you are talking about that is giving me problems. I can't figure out how to use the payrate to display the name a department of all those who make more tat 15 dollars an hour. And it it can use a 3d array, that am i sure of.. any ideas.. thanks for the help.