Thread: Need help to fix code

  1. #16
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    What sort of problem? Remember that thing we just talked about, about including the errors you get?

    Quzah.
    Hope is the first step on the road to disappointment.

  2. #17
    Registered User
    Join Date
    May 2009
    Posts
    16
    The errors are:
    In function `int main()':
    1) void value not ignored as it ought to be

  3. #18
    Registered User
    Join Date
    May 2008
    Location
    India
    Posts
    30
    Quote Originally Posted by chakra View Post
    second getNumber declaration void getNumber(void); it is not matching with the way you are using..

    your declaration should have num/int getNumber(void). Give a return inside the function.

    .
    ......

  4. #19
    Registered User
    Join Date
    May 2009
    Posts
    16
    I don't understand how to fix what Chakra said in #18.

  5. #20
    Registered User
    Join Date
    May 2008
    Location
    India
    Posts
    30
    Quote Originally Posted by anik18 View Post
    I don't understand how to fix what Chakra said in #18.
    As per your code
    Code:
    inPut = getNumber();
    getNumber() is supposed to return something. Here you are assigning it to inPut, So make sure it has the same return type for the getNumber.

    Your declaration of getNumber is void getNumber(void). You are saying your function is returning nothing and yet you are expecting value from the getNumber function.

    so change prototype declaration for your function.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 28
    Last Post: 07-16-2006, 11:35 PM
  2. Replies: 1
    Last Post: 05-26-2006, 08:13 AM
  3. Obfuscated Code Contest
    By Stack Overflow in forum Contests Board
    Replies: 51
    Last Post: 01-21-2005, 04:17 PM
  4. Updated sound engine code
    By VirtualAce in forum Game Programming
    Replies: 8
    Last Post: 11-18-2004, 12:38 PM
  5. Interface Question
    By smog890 in forum C Programming
    Replies: 11
    Last Post: 06-03-2002, 05:06 PM