skiping inputs

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Apr 2006
Posts: 42
Reputation: ghadahelal is an unknown quantity at this point 
Solved Threads: 0
ghadahelal ghadahelal is offline Offline
Light Poster

skiping inputs

 
0
  #1
May 2nd, 2006
how can i skip the 1st 2 lines from my input file
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 5,266
Reputation: iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold 
Solved Threads: 377
Featured Poster
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Posting Expert

Re: skiping inputs

 
0
  #2
May 2nd, 2006
>how can i skip the 1st 2 lines from my input file

  1. Read file in line by line
  2. If line number equals 1 or 2
  3. then
  4. //ignore
  5. endif
  6. else
  7. //do other stuff
Reply With Quote Quick reply to this message  
Join Date: Apr 2006
Posts: 42
Reputation: ghadahelal is an unknown quantity at this point 
Solved Threads: 0
ghadahelal ghadahelal is offline Offline
Light Poster

Re: skiping inputs

 
0
  #3
May 2nd, 2006
do u know how 2 make cin>> with \n , i mean the syntex 2 write it
i want 2 make only 2 \n
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 5,266
Reputation: iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold 
Solved Threads: 377
Featured Poster
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Posting Expert

Re: skiping inputs

 
0
  #4
May 2nd, 2006
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.
Reply With Quote Quick reply to this message  
Join Date: Apr 2006
Posts: 42
Reputation: ghadahelal is an unknown quantity at this point 
Solved Threads: 0
ghadahelal ghadahelal is offline Offline
Light Poster

Re: skiping inputs

 
0
  #5
May 2nd, 2006
i don't understand what do u mean.
do u know the \n
and the ignore function
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 5,266
Reputation: iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold 
Solved Threads: 377
Featured Poster
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Posting Expert

Re: skiping inputs

 
0
  #6
May 2nd, 2006
If you don't know what getline is then maybe you should google it?
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC