starbright
Grünschnabel
Bin zu blöd einen String zu kopieren. Was mach ich falsch?
Hatte mir das ungefähr so gedacht:
abc.exe text1 text2
aber strcpy geht nicht!?
int main(int argc, char *argv[])
{
char *sFileName;
char *sFileOut;
printf("%i\ %s %s %s %s\n",argc, argv[0], argv[1], argv[2], argv[3]);
printf("%s\n",argv[1]);
strcpy(sFileOut,argv[1]);
strcpy(sFileName,argv[1]);
printf("%s\n",sFileName);
printf("%s\n",sFileOut);
}
Hatte mir das ungefähr so gedacht:
abc.exe text1 text2
aber strcpy geht nicht!?
int main(int argc, char *argv[])
{
char *sFileName;
char *sFileOut;
printf("%i\ %s %s %s %s\n",argc, argv[0], argv[1], argv[2], argv[3]);
printf("%s\n",argv[1]);
strcpy(sFileOut,argv[1]);
strcpy(sFileName,argv[1]);
printf("%s\n",sFileName);
printf("%s\n",sFileOut);
}