473,385 Members | 1,843 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Pointers and Strings Help

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;
tmp_ptr++;
}

The output could look something like this:

'The big dog ran away ' (excluding the quote
marks)

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?

Thanks,

Treshauna

Aug 1 '05 #1
1 1035
use std::stringstream to send output to a string,
and for trimming white spaces from string follow this link
http://www.codeproject.com/vcpp/stl/stdstringtrim.asp

Aug 2 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: agent349 | last post by:
First off, I know arrays can't be compared directly (ie: if (arrary1 == array2)). However, I've been trying to compare two arrays using pointers with no success. Basically, I want to take three...
1
by: ketema | last post by:
Hello, I was wondering if someone could help me with a function I am trying to write. The purpose of the function is to read in text from a file in the following format: FIRSTNAME LASTNAME...
4
by: rp | last post by:
I am having problems with array of pointers. Could someone tell me whats the problem with my program, shown below. #include <stdio.h> #include <string.h> #define NUM_KEYWORDS 3 char *table...
3
by: gordy | last post by:
Newbie question, please by gentle. I'm trying to read in a text file containing the days of the week, one on each line. Each line should be pointed to by an array of pointers to char but I'm...
9
by: uotani.arisa | last post by:
Hi, Can someone tell me how to declare a pointer to a vector of pointers? I'm just not sure how to do this... I've tried essentially the following: vector<string *> * v; ....
23
by: sandy | last post by:
I need (okay, I want) to make a dynamic array of my class 'Directory', within my class Directory (Can you already smell disaster?) Each Directory can have subdirectories so I thought to put these...
13
by: arnuld | last post by:
at the very beginning of the chapter, i see some statements i am unable to understand. i know the "Pointer" takes the address of a variable, useful if, in case, we want to manipulate that variable...
15
by: edson | last post by:
Greetings. My microcontroller program uses arrays of strings. I want to store the strings AND their pointers in ROM. I am able to initialize the arrays so that the strings are put in ROM, but the...
5
by: ramu | last post by:
Hi, Could anyone please tell me how to dereference a pointer to an array of pointers? Regards
3
by: JOhn | last post by:
can someone please post some complicated question on pointers?? moreover while reading pointers I found out that there is a lot of difference between an arracy of intergers and an array of...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.