By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,130 Members | 1,359 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,130 IT Pros & Developers. It's quick & easy.

Pointers and Strings Help

P: n/a
Need help with this problem.

I am searching a file for certain information using pointers.

If i find the information I'm looking for, then i output the pointer to
the screen using a while loop.

For example:

while(*tmp_ptr != '\'')
cout << *tmp_ptr;

The output could look something like this:

'The big dog ran away ' (excluding the quote

I want to somehow create a string that will put this output into it so
that I can get rid of the extra white space at the end.

Any ideas?



Aug 1 '05 #1
Share this Question
Share on Google+
1 Reply

P: n/a
use std::stringstream to send output to a string,
and for trimming white spaces from string follow this link

Aug 2 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.