argc parameter in main function doesn't include redirection command [<, >], but I faced a confusing problem when using a double quote:
- Shell: CMD
- I expected
argcis3andYes!:a.exe aa bb < input.txt
- I expected
argcis also3, but5, as I want to input double quote as argument:a.exe \" bb < input.txt
- I expected
^"? (2) What isa.exe? (3) Do you know what_setargv()thisa.exeuses? What is it? – Kamil Maciorowski Feb 07 '24 at 13:302and argv[1] is empty . (2)a.exe is simple program, print agrc. (3) i dont know that. i dont use it my code. – Doge Feb 07 '24 at 13:41_setargv(). See the second part of this answer. I don't expect the situation has changed, so probably it's totally up toa.exe(i.e. up to_setargv()it uses), how exactly it splits the string you give it to an array of arguments, how it interprets quotes and escape characters, and what quotes and escape characters. – Kamil Maciorowski Feb 07 '24 at 13:49"^"". – harrymc Feb 07 '24 at 14:22