I just wrote a program in c language which uses command line arguments and i tried to print the first argument. when i execute program with following command
./a.out $23
and try to print the first argument using the below code
printf("%s", argv[1]);
the output is just
3
Am i missing something here, that command line arguments are treated differently if some special characters are present. can some one explain this behavior.
You need to escape the
$character.Try this: