Well, now i cant do some other stuff...
In this code, the file text.txt is beeing deleted.
Code:
#include <stdio.h>
#include <string.h>
int main (void)
{ char fname[260];
int seq = 2;
sprintf(fname,"text%d.txt",seq);
rename("c:\\temp\\text.txt", fname);
return 0; }
The code I uded is ok, but Im getting this problem when I added "scanf":
Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main ()
{
char var[] = "";
char str[80];
scanf("%c", &var);
strcpy (str,"ren C:\\temp\\text.txt text");
strcat (str, var );
strcat (str,".txt");
puts (str);
system(str);
system("pause");
return 0;
}
If I put the number 632, the result is something like 6♂².
Dont know what is happening... =P