Hi i get a
"subscripted value is neither array nor pointer"
when i compile my source.
the error is pointing this line
argc is the argument taken from the program parametersCode:if(strncmp(">", argc[i], 1) == 0)
Printable View
Hi i get a
"subscripted value is neither array nor pointer"
when i compile my source.
the error is pointing this line
argc is the argument taken from the program parametersCode:if(strncmp(">", argc[i], 1) == 0)
Perhaps you wanted argv? You may also say:
Code:if(argv[i][0] == '>') // blah blah
It looks like the program does not pick up the > character. It will assumedly pipe it out to what ever is on the other end.
If you put it in quotes it will work. This could be awkward for your application however.
The |, < and > characters are stripped by the OS and not passed to the program. Unless you surround them with "s
you could also lookup the ascii value for the character '>' and use that instead in the comparison
Won't work, the ">" won't get sent to the program in the first place.
Maybe you could try use a different symbol...
Are you sure you don't want this?Code:if(strncmp(">", argc[i], 1) == 0)
Code:if(strncmp(">", argv[i], 1) == 0)