Hi all,
I am pretty new to c++ programming but fairly good at VB.
My question is this:-
I want to create an array of strings such that
string[1]="sheep"
string[2]="cows "
string[3]="pigs " etc etc...(which is easy in VB)
The problem is that strings themselves are treated as character arrays in c++
so I need a 2 dimensional array, eg. animals[10][10]
the problem is I can declare the array, but then I cannot get it to accept any input as strings for example...
animals[5][5]="A" works and puts the character "A" at 5,5 but
animals[5][5]="pigs " does not, neither does
animals[][5]="pigs " or
animals[5][]="pigs ".
is there any way of assigning strings directly to arrays like this or will I have to start using pointers?
Thanks in anticipation
by the way, this is not homework, I am 42 years old!