|
-
January 5th, 2009, 06:00 PM
#1
[RESOLVED] Question about infinite word/phrase input, terminated by a specific word
Hey everyone. I'm new here, and I'm kinda newbie with C++. So, here's my question.
I want to make a program in C++ which receives phrases by the user, strings or char vectors, not decided which one to use yet. So, I want it to use a pointer, but not sure exactly how to program it. My idea is that there'll be a cicle which creates a new vector or a string with the pointer for each next word.... And the cicle ends when I write END.
To picture it a little more explicit:
Program example input:
(enter is for when the user presses enter)
Start inputing words:
Word (enter)
This is a word (enter)
this is not a word (enter)
It's a phrase (enter)
END (enter)
So, I'm not really sure if this can be done in C++, I mean I can do it with an array, but the size of it is fixed, so I can't really input an infinite list of words of phrases.
Any ideas?
Thanks in advance
PS: It's a console program, not a graphic one, I'm not there yet
Last edited by gtbgmaniak; January 5th, 2009 at 06:01 PM.
Reason: Add PS
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|