conflicting types for function

watn0w's Avatar
Newbie Member
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.
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Can you share the code of the complete file as everything seems ok with the above function.
0
Aztec's Avatar, Join Date: May 2006
Contributor
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.