#include<stdio.h>
#include<string.h>
int main(int argc,char *argv[])
{
char string[]="#";
printf("%s\n",argv[1]);
printf("%s\n",argv[2]);
printf("%s\n",argv[3]);
strcat(argv[1],string);
printf("argv[1] is %s\n",argv[1]);
printf("argv[2] is %s\n",argv[2]);
printf("argv[3] is %s\n",argv[3]);
return 0;
}
when I use strcat() to add something to the end of the argv[1],argv[2] will be lost( strlen(argv[2]) changes to 0 after use strcat ).But argv[3] has no change .Why???