I'll try again... First there are some questions to be answered... Is this for C++ or C? Do you want a 2d array of strings, or were you hoping to have a string and two ints for each entry?
Assuming the answers are "C++" and "strings" then the code below will do the job.
istream& readRow( istream& is, vector< string >& vec )
{
vec.clear();
string input;
if ( getline( is, input ) ) {
istringstream iss( input.c_str() );
copy( istream_iterator<string>( iss ), istream_iterator<string>(), back_inserter( vec ) );
}
return is;
}
int main( int argc, char *argv[] )
{
if ( argc != 2 ) {
cout << "Usage " << argv[0] << " file.txt\n";
exit( -1 );
}
ifstream file( argv[1] );
vector< vector< string > > stuff;
vector< string > input;
while ( readRow( file, input ) ) {
stuff.push_back( input );
}
// stuff is your 2d array
}