wrote:
> A little more background: the string is a parameter to an exe.
>
> configman.exe -list name;address1;add&rest;addres3
>
> But when I want to pass the string to the tokenize function it looks
> like this:
>
> inString="name;address1;add ";
>
>
> ?????
>
> Do you still want to see the tokenize function?
>
> Can you help me now? Go on..
<OT>
If the string is being passed in on the command line, then it is your
command interpreter that is doing the conversion. On Windows Command
Prompt, the ampersand is used to chain together commands, like
"dir&echo hi" will execute the "dir" command, then execute the "echo hi"
command.
If you want to pass the ampersand into your program, put it in double
quotes.
</OT>
Try passing your command line arguments to this program to see exactly
what is happening:
#include <iostream>
int main(int argc, char* argv[])
{
for (int i = 0; i < argc; ++i) {
std::cout << "argv[" << i << "] = " << argv[i] << '\n';
}
}
--
Marcus Kwok
Replace 'invalid' with 'net' to reply