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

标签 c types basic redefinition

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

我收到此错误。主要是第 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/

相关文章:

basic - BASIC 中的井号/井号代表什么?

c - 链表 while 循环的段错误

java - 如何用C、C++、Java等语言动态生成HTML?

c - 为什么 Linux 中的 Makefile 如此有用?

c - 如何将数组字符串传递给c函数?

Haskell:有时返回函数的函数

loops - FOR/NEXT 带有多个下一个命令

history - REM 在 BASIC 中代表什么?

TypeScript:接受映射到特定类型的所有对象键

c# - Roslyn 的 GetTypeByMetadataName() 和通用类型