Thread: Parameter error in Main

  1. #1
    Registered User
    Join Date
    Nov 2007
    Posts
    19

    Parameter error in Main

    My main gives compiles an error
    Code:
    void schrijfOutput( char nummer, char waarde );
    char leesOutput( char nummer, unsigned char* ddr );
    char leesRX( unsigned char* ddr );
    void leesRegister( unsigned char* Register )
    
    int main( int argc, char** argv )
    {
      unsigned char ddr[4];
      leesRegister( ddr );
      
      while( !leesOutput( 1, ddr ) ) // Blijft in de lus zolang uitvoer 1 niet waar is
      {
        usleep( 100 );
        leesRegister( ddr );
      }
    }
    The error that appears is
    Code:
    E4092C: both separate parameter declaration and parameter list declaration are used
    Though a function is defined with a prototype declaration, non-prototype parameters are
    also declared. The separate parameter declaration is not needed.


    I can't fix this error, maybe someone can see it?

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    The global main function should not have a prototype. Why not provide the smallest and simplest program that demonstrates the compile error?
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Code:
    void schrijfOutput( char nummer, char waarde );
    char leesOutput( char nummer, unsigned char* ddr );
    char leesRX( unsigned char* ddr );
    void leesRegister( unsigned char* Register );
    Perhaps a missing semicolon, added above?

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  4. #4
    Registered User
    Join Date
    Nov 2007
    Posts
    19
    Oh yes I see, thats a bit stupid of me. It doesn't give the error anymore, thank you for watching and the advice!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. help on main()
    By braddy in forum C Programming
    Replies: 9
    Last Post: 03-21-2008, 11:16 AM
  2. differences between int main and void
    By louis_mine in forum C Programming
    Replies: 6
    Last Post: 09-25-2004, 06:49 AM
  3. Defining main function!
    By alvifarooq in forum C++ Programming
    Replies: 8
    Last Post: 09-19-2004, 02:00 PM
  4. what to do with the main window
    By stallion in forum Windows Programming
    Replies: 2
    Last Post: 01-28-2003, 08:58 PM
  5. void or int for main?:)
    By bigtamscot in forum C Programming
    Replies: 13
    Last Post: 09-27-2001, 03:11 AM