#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <ctype.h>
//将字符串中的小写字母转成大写字母
void Save(char *path,char *str)
{
FILE *fw = fopen(path,“w”);
assert(fw != NULL);
char tmp;
while((tmp=*str) != ‘\0’)
{
if(islower(tmp))
{
tmp = toupper(tmp);
}
fwrite(&tmp,sizeof(char),1,fw);
str++;
}
fclose(fw);
}
int main()
{
char *path = “1.txt”;
Save(path,“adsfajerutwerWERIASDF1342123xyzadfWER”);
return 0;
}