no matching function for call

no matching function for call to `getline(std::string&, char&)'
Why is this error occuring?
HELP ME SOLVE THIS
My Aim is to copy each character or integer to an array
A.S.A.P
MY PROGRAM:-

#include <fstream>
#include <iostream>
#include<conio.h>
#include<string.h>
using namespace std;

int main ()
{ char a[50];

ifstream someStream( "txt.txt" );


string line;


getline( someStream, line );


while( !someStream.eof() )
{

getline( someStream, line );
cout<<line<<endl;
for(int i=0;i<=50;i++)
{
getline(line,a[i]);
}
}


getch();
return 0;
}
Last edited on
getline(line,a[i]); What are you doing here?
If you want to copy content of line into a, you should use c-string manipulation functions: strncpy(a, line.c_str(), 49);
*edit*
Last edited on
Topic archived. No new replies allowed.