redefinition; different basic types

2.8k views Asked by At

I've been doing a little coding with structures and i'm getting an consistent error that no one seems to can solve.

I'm getting this error.Line 1 mostly.

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'

for this structure

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;

This is the includes

#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();
}

I have no clue what i'm doing wrong. Can anyone helP

1

There are 1 answers

1
Dialecticus On

The code has several errors. The answer to your question is that instead of this:

typedef struct register_
{
    ...
} regis;

you should write this:

struct regis
{
    ...
};

After you make this change you will probably discover some other errors.