c++ argv[1] something strange -
i got strange problem parsing c++ arguments argv[]
. here sample of code:
int main(int argc, char **argv) { (int i=0; <argc; i++) printf("argv[%d] = %s|\n", i, argv[i]); return 0; };
when run program this:
./myprogram --aaa-a --bbb-b --ccc-c
the result like:
argv[0] = myprogram| argv[1] = --aaa-a --bbb-b| argv[2] = --ccc-c
but when try:
./myprogram --aaa-a --bbb-b --ccc-c
with additional space between aa , bb, got:
argv[0] = myprogram| argv[1] = --aaa-a| argv[2] = --bbb-b| argv[3] = --ccc-c|
does can give me clue happening here?
for reason have non-breakable space (or character that's displayed space) between --aaa-a
, --bbb-b
. remove whole command line , write again scratch.
Comments
Post a Comment