D
dmurray14
Hey guys,
I'm a C++ newbie here - I've messed with VB, but I mostly stick to web
languages, so I find C++ to be very confusing at times. Basically, I am
trying to import a text file, but I want to do it word by word. I am
confused as to how to do this. Typically, I would think it would make
sense to try and input the words into strings, but for this application
I need to use character arrays and pointers. So what's the best way to
go about this? I know what I need to do - go character by character and
dump into an array until we get to either a space or some other form of
punctuation, but I'm having trouble getting this into code. If any of
you could share some ideas on how to go about this, it would be much
appreciated! I'm assuming its going to be something like a while loop
that imports characters while != a space, comma, period, etc, then
stops when it gets to that. But again - not sure how to do this by
character - I'm used to strings.
Thanks a lot, much appreciated!
Dan
I'm a C++ newbie here - I've messed with VB, but I mostly stick to web
languages, so I find C++ to be very confusing at times. Basically, I am
trying to import a text file, but I want to do it word by word. I am
confused as to how to do this. Typically, I would think it would make
sense to try and input the words into strings, but for this application
I need to use character arrays and pointers. So what's the best way to
go about this? I know what I need to do - go character by character and
dump into an array until we get to either a space or some other form of
punctuation, but I'm having trouble getting this into code. If any of
you could share some ideas on how to go about this, it would be much
appreciated! I'm assuming its going to be something like a while loop
that imports characters while != a space, comma, period, etc, then
stops when it gets to that. But again - not sure how to do this by
character - I'm used to strings.
Thanks a lot, much appreciated!
Dan