-5
我一直在做結構的一點編碼,我得到了一個似乎沒有人能解決的一致性錯誤。重新定義;不同的基本類型
我得到這個錯誤。大部分是線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();
}
我不知道我在做什麼錯。 任何人都可以幫助
請不要使用C++代碼片段 - 它只適用於網絡技術。謝謝。 – 2014-11-14 13:09:16
這是一種非常類似於C的風格,看起來不像C++。如果這個例子來自一本書或網站,你應該尋找一個更新的資源來學習。 – NicholasM 2014-11-14 13:28:44
你在'main'裏聲明瞭很多函數,但是你只需要調用其中的三個 - 在你已經返回之後調用它們。你應該重新閱讀你的好書中關於功能的章節。在編譯之前,你不應該編寫太多的代碼。 – molbdnilo 2014-11-14 13:44:17