954,535 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

skiping inputs

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

ghadahelal
Light Poster
42 posts since Apr 2006
Reputation Points: 10
Solved Threads: 0
 

>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 
   then 
     //ignore
   endif
 else
  //do other stuff
iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
 

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

ghadahelal
Light Poster
42 posts since Apr 2006
Reputation Points: 10
Solved Threads: 0
 

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.

iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
 

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

ghadahelal
Light Poster
42 posts since Apr 2006
Reputation Points: 10
Solved Threads: 0
 

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

iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You