conflicting types for function

Newbie Member
22Nov2006,21:47   #1
watn0w's Avatar
Sorry I know this has been posted before but the solutions to the other problems doesn't seem to work with this.
Code:
char 
readABchoice()
{         
       scanf( "%c", &input );
       getchar();
       
       if( input == 'A' || input == 'a' || input == 'B' || input == 'b' ){
           
       } 
       else{
       printf( "(A/a or B/b): " );
       }

       return input;      
}
it says that theres a conflicting type for 'readABchoice' i already have a function protocol for it. and input is a global variable that i've declared up above main. any help would be great thanks

Last edited by shabbir; 22Nov2006 at 22:02.. Reason: Code formating.
Go4Expert Founder
22Nov2006,22:03   #2
shabbir's Avatar
Can you share the code of the complete file as everything seems ok with the above function.
Contributor
23Nov2006,08:39   #3
Aztec's Avatar
Quote:
Originally Posted by watn0w
it says that theres a conflicting type for 'readABchoice' i already have a function protocol for it.
But there could be a possibility that your prototype is not matching the defination.
But if you really want exact reason then give 1 small compilable code which we can check.