B
Bit Byter
I have a method in a class implemented like this:
int foo (const char* filename, bool flg)
{
FILE *fp;
char *buffer, *tokstr, *tmp;
size_t size, toksize;
unsigned int i;
if ((fp = fopen(filename, "r")) == NULL)
return FILE_READ_ERROR;
if (flg) {
buffer = NULL;
if (getline(&buffer, &size, fp) == -1) { // <- COMPILER BARFS HERE
!
......
}
}
}
Error message I'm getting is this:
myfile.cpp(1033): error C2780: 'std::basic_istream<_Elem,_Traits>
&std::getline(std::basic_istream<_Elem,_Traits>
&,std::basic_string<_Elem,_Traits,_Alloc> &)' : expects 2 arguments - 3
provided
Any ideas how I can use getline using file pointer?
int foo (const char* filename, bool flg)
{
FILE *fp;
char *buffer, *tokstr, *tmp;
size_t size, toksize;
unsigned int i;
if ((fp = fopen(filename, "r")) == NULL)
return FILE_READ_ERROR;
if (flg) {
buffer = NULL;
if (getline(&buffer, &size, fp) == -1) { // <- COMPILER BARFS HERE
!
......
}
}
}
Error message I'm getting is this:
myfile.cpp(1033): error C2780: 'std::basic_istream<_Elem,_Traits>
&std::getline(std::basic_istream<_Elem,_Traits>
&,std::basic_string<_Elem,_Traits,_Alloc> &)' : expects 2 arguments - 3
provided
Any ideas how I can use getline using file pointer?