how can i skip the 1st 2 lines from my input file

Recommended Answers

All 5 Replies

Member Avatar for iamthwee

>how can i skip the 1st 2 lines from my input file

Read file in line by line
 If line number equals 1 or 2 
  //do other stuff

do u know how 2 make cin>> with \n , i mean the syntex 2 write it
i want 2 make only 2 \n

Member Avatar for iamthwee

To read in a line, assuming your file is a plain text file, you can use
cin.getline() or getline - assuming you read in each line as a std::string.

i don't understand what do u mean.
do u know the \n
and the ignore function

Member Avatar for iamthwee

If you don't know what getline is then maybe you should google it?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.