Weird Question

I need help figuring out exactly what this problem is trying to get me to do:

Design an algorithm that uses one or many loops to iteratively parse a string of a set of given characters, namely (@#,./()*&-_[]<>””’’).

I am supposed to use for loops but I don't know where to even begin.
You could start with a std::string. Individual characters can be accessed using similar notation to an array. So if name is a string, name[0] is the first character, name[n] is the nth character. The length of the string is given by name.length().

Armed with that information, you can begin to code a loop (maybe using for or while) to examine each character in turn.

The action you take will depend on whether any character has special significance. Presumably you have that information. This part is potentially the most complicated, but without any information to go on, it remains a blank.

Last edited on
Mostly semantics but name[n] is the n + 1 character such that name[1] is the 2nd character so on...
Topic archived. No new replies allowed.