Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   conflicting types for function (http://www.go4expert.com/forums/conflicting-types-function-t1969/)

watn0w 22Nov2006 21:47

conflicting types for function
 
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 :)

shabbir 22Nov2006 22:03

Re: conflicting types for function
 
Can you share the code of the complete file as everything seems ok with the above function.

Aztec 23Nov2006 08:39

Re: conflicting types for function
 
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.


All times are GMT +5.5. The time now is 07:45.