gpt4 book ai didi

c - 重新定义;不同的基本类型

转载 作者:行者123 更新时间:2023-11-30 21:37:46 24 4
gpt4 key购买 nike

我一直在用结构进行一些编码,但遇到了一个似乎无人能解决的一致错误。

我收到此错误。主要是第 1 行。

1>c:\users\kevin\documents\visual studio 2010\projects\is the complier trying to piss me off\is the complier trying to piss me off\lets find out.cpp(91): error C2371: 'regis' : redefinition; different basic types
1> c:\users\kevin\documents\visual studio 2010\projects\is the complier trying to piss me off\is the complier trying to piss me off\lets find out.cpp(10) : see declaration of 'regis'

对于这个结构

typedef struct register_
{
int cyear;// current year
int age, id, register_date, tele[15];
char choice[3], name[20], email[20], category[10];
char unique[20]; //password enter
}regis;

这是包含内容

#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>
#include <conio.h>

void screen();
char desion(char, char);
char reg,log;
int worker_menu(char signup(struct regis));
int customer_menu(char signup(struct regis));
void in(struct enter);
char signup(struct regis);
void category(struct regis);
int time(struct register_ regis);
char add(struct movie, struct regis);
char change(struct add, struct regis, struct movie);
char today_list(struct list, struct regis, struct movie, struct add, int, int);
char bought(struct list);
void finish(struct buy, struct ticket);
int size;
float *price;
int *id,*duration;
char *unique,*code,*status,*type,*director,*ratings,*date,*title;
int rand(void);
int choice;

void main()
{
screen();
char signup(struct regis);
char desion(char, char);
while (choice !=0)
{
switch(choice)
{
case 1:
void in(struct login enter);
break;
case 2:
char signup(struct regis, struct born);
break;
case 3:
char add(struct movie, struct regis);
break;
case 4:
char change(struct add, struct regis, struct movie);
break;
case 5:
char today_list(struct list, struct regis, struct movie, struct add, int, int);
break;
case 6:
char bought(struct list);
break;
case 0:
printf("ending program\n");
default:
printf("invalid option\n");
break;
}
void screen();
}
return;
getche();
}

我不知道我做错了什么。谁能帮忙

最佳答案

该代码有多个错误。你的问题的答案是:

typedef struct register_
{
...
} regis;

你应该这样写:

struct regis
{
...
};

进行此更改后,您可能会发现一些其他错误。

关于c - 重新定义;不同的基本类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26930689/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com