Thread: please help!!! error

  1. #1
    Registered User
    Join Date
    Apr 2003
    Posts
    17

    please help!!! error

    its weird..and seem easy. yet i can'f figure it out.
    every time i tried to run this program is say
    "error C2447: missing function header (old-style formal list?)"

    //finding the value of paased number

    #include<stdio.h>
    int whole(int,int);
    int main()
    {
    int AnyNum,AssigNum,TolNum;
    AssigNum = 20;

    printf("please enter value for AnyNum:");
    scanf("%d",&AnyNum);

    TolNum = whole(AnyNum,AssigNum);

    printf("the passed number is %d", TolNum);
    return 0;
    }

    int whole(int x, int y);
    {
    int TolNum;
    if(x!=y, --x)
    TotNum = x;
    return (TolNum);
    }

  2. #2
    Registered User
    Join Date
    Mar 2003
    Location
    UK
    Posts
    170
    >int whole(int x, int y);
    >{

    remove the ; at the end of line.

  3. #3
    Registered User
    Join Date
    Jan 2003
    Posts
    10
    in int whole(int x, int y) at the bottom you have defined tolnum but used totnum....i've fixed it so it now works
    check out the code below!

    Code:
    #include<stdio.h>
    int whole(int,int);
    
    int main()
    {
      int AnyNum,AssigNum,TolNum;
      AssigNum = 20;
    
      clrscr();
            
       printf("please enter value for AnyNum:");
       scanf("%d",&AnyNum);
    
       TolNum = whole(AnyNum,AssigNum);
    
       printf("the passed number is %d", TolNum);
       getch();
       return 0;
    }
    
    int whole(int x, int y)
    {
      int TotNum;
      
       if(x != y, --x)
       TotNum = x;
       return (TotNum);
    }

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Getting an error with OpenGL: collect2: ld returned 1 exit status
    By Lorgon Jortle in forum C++ Programming
    Replies: 6
    Last Post: 05-08-2009, 08:18 PM
  2. An error is driving me nuts!
    By ulillillia in forum C Programming
    Replies: 5
    Last Post: 04-04-2009, 09:15 PM
  3. Making C DLL using MSVC++ 2005
    By chico1st in forum C Programming
    Replies: 26
    Last Post: 05-28-2008, 01:17 PM
  4. Connecting to a mysql server and querying problem
    By Diod in forum C++ Programming
    Replies: 8
    Last Post: 02-13-2006, 10:33 AM
  5. Couple C questions :)
    By Divx in forum C Programming
    Replies: 5
    Last Post: 01-28-2003, 01:10 AM