View Single Post
Old 09-20-07, 09:20 PM   #4
six_storm
Registered User
 
six_storm's Avatar
 
Join Date: Jun 2004
Location: Nashvegas
Posts: 11,575
Send a message via Skype™ to six_storm
Default Re: C++ Gurus, School Me :D

I'd hate to make another thread but I have another question. CHAR ARRAYS.

So I need to make a char array in a struct and have it read in from a file. HEre is my code:

Code:
struct myStruct
{
char *name[60];
};

main()
{
int x=0;
myStruct mainStruct;
ifstream inFile;
inFile.open("input.txt");

while(!inFile.eof())
{
inFile >> mainStruct.name[x];
x++
}

return 0;
}
I keep getting errors in the syntax but I can't figure out what it is. Any hints would be appreciated.
six_storm is offline   Reply With Quote