Thread: thanks tim

Results 1 to 30 of 91

Threaded View

  1. Collapse Details
     
    #11
    fams casino syn's Avatar
    Join Date
    Dec 2011
    Location
    flavor town
    Posts
    3,771
    Quote Originally Posted by maks View Post
    I hope you're not asking me because I can barely bash script and know nothing about any real languages
    :( Well if you were wondering..

    The reason to use foo(void) in C and not in C++ is because C++ is stricter about how functions are called.In C, if you leave out the (void) part, you can call the function with any amount of arguments

    Code:
    int foo();
    // defined somewhere
    
    // these are all valid, will not issue compiler errors
    foo(1, 2, 3, 4, 5);
    foo();
    foo("hello", 1.2345, 1);

    If you did declare it with
    Code:
    int foo(void)l
    then all those would generate compiler errors. In C++
    Code:
    int foo();
    means the same as
    Code:
     int foo(void)
    in C C++ will give out errors if you try and call the function with arguments
    Last edited by syn; 06-14-2012 at 09:34 PM.
    Reply With Quote
     

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •