look at the definition of getline()
basic_istream& getline(char_type *str, streamsize count);
basic_istream& getline(char_type *str, streamsize count, char_type delim);
The first argument is a pointer to char_type. You on the other hand are passing a pointer to a 2D array of integer.
You will need to read in the integer values as strings ( eg "123") or at least a series of char and then convert from char string to integer.
Main Topics
Browse All Topics





by: doraemon2555Posted on 2009-04-18 at 20:11:50ID: 24177792
With getline(), you try getting line from a file, the signature of the function will be:
getline(char**, size_t*, FILE*)
getdelim(char**, size_t*, int, FILE*)
Make sure your myArr is what you want to put (Do you want to dereference once first? It was a 2D array)
Check also the size you pass into the getline/getdelim will not overflow your char array...