944,066 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 1044
  • C++ RSS
May 2nd, 2006
0

skiping inputs

Expand Post »
how can i skip the 1st 2 lines from my input file
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
ghadahelal is offline Offline
42 posts
since Apr 2006
May 2nd, 2006
0

Re: skiping inputs

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

C++ Syntax (Toggle Plain Text)
  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
Featured Poster
Reputation Points: 1536
Solved Threads: 431
Posting Expert
iamthwee is offline Offline
5,865 posts
since Aug 2005
May 2nd, 2006
0

Re: skiping inputs

do u know how 2 make cin>> with \n , i mean the syntex 2 write it
i want 2 make only 2 \n
Reputation Points: 10
Solved Threads: 0
Light Poster
ghadahelal is offline Offline
42 posts
since Apr 2006
May 2nd, 2006
0

Re: skiping inputs

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.
Featured Poster
Reputation Points: 1536
Solved Threads: 431
Posting Expert
iamthwee is offline Offline
5,865 posts
since Aug 2005
May 2nd, 2006
0

Re: skiping inputs

i don't understand what do u mean.
do u know the \n
and the ignore function
Reputation Points: 10
Solved Threads: 0
Light Poster
ghadahelal is offline Offline
42 posts
since Apr 2006
May 2nd, 2006
0

Re: skiping inputs

If you don't know what getline is then maybe you should google it?
Featured Poster
Reputation Points: 1536
Solved Threads: 431
Posting Expert
iamthwee is offline Offline
5,865 posts
since Aug 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: C++ Builder 6 - Database Search
Next Thread in C++ Forum Timeline: Please Help With Linked List Programming





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC