conflicting types for function

Discussion in 'C' started by watn0w, Nov 22, 2006.

  1. watn0w

    watn0w New Member

    Joined:
    Nov 22, 2006
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    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 a moderator: Nov 22, 2006
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    Can you share the code of the complete file as everything seems ok with the above function.
     
  3. Aztec

    Aztec New Member

    Joined:
    May 9, 2006
    Messages:
    90
    Likes Received:
    0
    Trophy Points:
    0
    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.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice