谁帮我看下这段C代码为什么在VS2010时编译时提示出错 出错提示:error C2065: “year”: 未声明的标识符
#include"stdafx.h"#include<stdio.h>#include<string.h>#include<stdlib.h>typedefstruct_...
#include "stdafx.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
typedef struct _INFO
{
int num;
char str[256];
}info;
typedef int number;
int main()
{
struct _INFO A;
info B;
A.num=2018;
number year =1987;
strcpy(A.str,"I fall in love with you at ");
B=A;
printf("%s %d !\n",A.str,A.num);
printf("%s %d !\n",B.str,B.num);
printf("I borthed in %d \n",year);
system("pause");
return 11;
} 展开
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
typedef struct _INFO
{
int num;
char str[256];
}info;
typedef int number;
int main()
{
struct _INFO A;
info B;
A.num=2018;
number year =1987;
strcpy(A.str,"I fall in love with you at ");
B=A;
printf("%s %d !\n",A.str,A.num);
printf("%s %d !\n",B.str,B.num);
printf("I borthed in %d \n",year);
system("pause");
return 11;
} 展开
- 你的回答被采纳后将获得:
- 系统奖励15(财富值+成长值)+难题奖励20(财富值+成长值)
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询