[求助]关于scanf不能正常赋值
我为编写c语言的作业的数据保存,编写了一个小测试程序,但这个程序遇到问题,scanf不能正常赋值,当将scanf("%c",&t);改为t=getch();后这儿过去了,后面整型和float型又过不去,最主要的,不知道为什么会这样!!
#include
#include
void write(FILE *fp);
void read(FILE *fp);
struct h{
char a;
int b;
long c;
struct h *next;
};
struct h *head;
void main (void)
{
int t,n;
struct h *p,*head;
int flag=1;
FILE *fp;
printf("Is this a new set file?(Y/N)");
scanf("%c",&t);
printf("Hello world 10");
if (t=='y'&&t=='Y')
{
printf("Hello world");
if((fp=fopen("mf","r"))==NULL) {
printf("