Update filename-test
This commit is contained in:
parent
b73e6fbf49
commit
0b77efbf7f
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,10 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||||
|
<CodeBlocks_layout_file>
|
||||||
|
<FileVersion major="1" minor="0" />
|
||||||
|
<ActiveTarget name="Debug" />
|
||||||
|
<File name="main.cpp" open="1" top="1" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor>
|
||||||
|
<Cursor1 position="56" topLine="0" />
|
||||||
|
</Cursor>
|
||||||
|
</File>
|
||||||
|
</CodeBlocks_layout_file>
|
|
@ -18,14 +18,13 @@ void write1(){
|
||||||
}
|
}
|
||||||
|
|
||||||
void test(){
|
void test(){
|
||||||
char filename[57];
|
char filename[57],str[57];
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
fp=fopen("test","r");
|
fp=fopen("test","r");
|
||||||
if(fp==NULL){printf("File not exist!");return ;}
|
if(fp==NULL){printf("File not exist!");return ;}
|
||||||
fgets(filename,57,fp);
|
fgets(str,57,fp);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
int length=strlen(filename);
|
sprintf(filename,"xe-%c.x",str[0]);
|
||||||
filename[length-1]='\0';
|
|
||||||
fp=fopen(filename,"w");
|
fp=fopen(filename,"w");
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue