cplusplus.com cplusplus.com
cplusplus.com   C++ : Forums : Beginners : Getting text from file
  Search:
- -
C++
Information
Documentation
Reference
Articles
Sourcecode
Forums
Forums
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programm...
Articles
Lounge
Jobs

-

post  Getting text from file

aakashjohari (33)
I want to get whole string from a file ending with an another string.

as i have textfile data.txt -

kjasjdjasdkjadajsdad/asdaskjdkasdkjakjdasd//jsdfjdasfjasjaffdasfdsfsdf//

i want to get whole string ending with "//" how can i do this?
|
LacViet (80)
The string class have member function such as string.find to help you find those thing. Check out this page to see if that is any help. :)

http://www.cplusplus.com/reference/string/string/find.html
|
Umz (153)
Use the getline function and read up to the //
You can learn to use it from:
http://www.cplusplus.com/reference/iostream/istream/getline.html
|

This topic is archived - New replies not allowed.
Home page | Privacy policy
© cplusplus.com, 2000-2009 - All rights reserved - v2.2
Spotted an error? contact us