if i wanna say "do it even the line is over",how can i say it with limitation
maybe like this (??????!="\n"
i wanna give some numbers from notepad like
12.2 21 32 32
332 234 543 5642
234 433
i wanna say give just the first line.or in other words do something to the end of first or second line,got it?
i wanna give some numbers from notepad like
12.2 21 32 32
332 234 543 5642
234 433
i wanna say give just the first line.or in other words do something to the end of first or second line,got it?
Well, you could use getline() to read the whole line and then process the contents of the line. Possibly a stringstream might be useful for parsing its contents.
i write a program to show me row and column of file like above but that not answering in correct me.plz tell me my mistake.
#include <iostream>
#include <string>
#include<fstream>
using namespace std;
int main()
{
string s,ss;
double x,y,z;
int * f;
int a,b,c,i,j,row,col;
ifstream A;
ofstream B;
ifstream C;
A.open("C:/Users/milad/Desktop/miladam.txt");
i=0;
while (!A.eof())
{
getline(A,s);
A>>s;
i++;
}
row=i;
A.close();