70,020
社区成员




#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <io.h>
int main(void)
{
FILE *fp;
char a[26] = "abcdefghijklmnopqrstuvwxy";
int i;
int j;
fp = fopen("test.txt", "w");
for (i = 0; i < 26; i++)
{
j = fputc((unsigned int)a, fp); // 为什么 fputc(int c, FILE *stream)中的c不能自动将char型转换为unsigned int 型
printf("%c", j);
}
printf("\n");
fclose(fp);
return 0;
}
#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <io.h>
int main(void)
{
FILE *fp;
char a[26] = "abcdefghijklmnopqrstuvwxy";
int i;
int j;
fp = fopen("test.txt", "w");
for (i = 0; i < 25; i++)
{
j = fputc((unsigned int)a, fp); // 为什么 fputc(int c, FILE *stream)中的c不能自动将char型转换为unsigned int 型
printf("%c", j);
}
printf("\n");
fclose(fp);
return 0;
}