View Single Post
Old 02-07-07, 01:56 PM   #5
Imbroglio
xeroyphyte
 
Imbroglio's Avatar
 
Join Date: Mar 2004
Posts: 1,271
Default Re: String Array in C

Quote:
Originally Posted by Tuork
I think I kinda figured it out. I know it's more or less a 2-dimensional array of chars, I just didn't know how to declare it.

As far as I can tell, its something like this:

char *myArray[10];
char *str = "string!";

myArray[3] = str;

That would leave "string!" in index 3 of myArray, wouldn't it?

yes, myArray[3] would get the pointer value of str. but don't get confused, if you change what str points to down the line, it would also change the value of myArray[3]
__________________

HT: 360 -- Sony60A3000 -- Onkyo SR605 --> Polk cs2, monitor 60s and monitor 40s w/ Bic F12 sub -- PS3
XBL:Mr X3r0 -- PSN:Mr_X3r0

Rig- Asus P6X58D Premium - intel i7 920 @3.6 - EVGA GTX570 - Corsair HX1000 - Prolimatech Mega Shadow - WD640 - COOLER MASTER ATCS 840 - OCZ Gold 6GB DDR3 1600*

Imbroglio is offline   Reply With Quote