Mail Archives: djgpp/1998/06/08/21:13:47
Hi.
I'm having a problem w/DJGPP's cin.getline w/a struct
Ok here's my code snippet
#include <iostream.h>
struct thing
{
unsigned char line[81];
int count;
};
void chng(thing &x);
void main(void)
{
thing *y;
chng(y);
}
// gxx complains here that there is no matching function call
// thing::thing(...then it gives some possible candidates
// for functions calls w/ & w/o variables
void chng(thing &x)
{
cin.getline(x.line, 81);
// This is suppose to be an ANSI call according to my text book
// (whoopee this a part of my final that's due tomorrow)
// But gxx complains that the correct call should be
// cin.getline(char *, int, char);
// even though iostream.h says that the last char is
// char n = '\n'
// I have never that type of function or method declaration
}
Please help me!
- Raw text -