Help with the C Tutorial on functions.

This is a discussion on Help with the C Tutorial on functions. within the C Programming forums, part of the General Programming Boards category; folem001 , if your variables are first defined, their type is not automatically used in the prototype. You must specify ...

  1. #16
    Registered User
    Join Date
    Sep 2008
    Location
    Toronto, Canada
    Posts
    1,832
    folem001, if your variables are first defined, their type is not automatically used in the prototype. You must specify the type explicitly.

    As stated by others, the variable names in the prototype are virtually ignored by the compiler. They are used only for your own information... so you can figure out what each parameter is for.

    Prototypes are for specifying the arguments' types.

    Code:
    int mult ( int,  int );
    ... is the only thing that matters to the compiler. But don't quote me on that - for all I know, this form of syntax may no longer be allowed in modern compilers.

  2. #17
    Registered User
    Join Date
    May 2010
    Posts
    13
    Brilliant,

    Thanks for your help!!

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need help with functions
    By jusfry01 in forum C Programming
    Replies: 2
    Last Post: 05-22-2010, 07:25 PM
  2. Functions calling other functions.
    By kbro3 in forum C++ Programming
    Replies: 2
    Last Post: 12-27-2009, 12:10 AM
  3. Compiling C in Visual Studio 2005
    By emanresu in forum C Programming
    Replies: 3
    Last Post: 11-16-2009, 04:25 AM
  4. Tutorial review
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 11
    Last Post: 03-22-2004, 09:40 PM
  5. Passing pointers between functions
    By heygirls_uk in forum C Programming
    Replies: 5
    Last Post: 01-09-2004, 06:58 PM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21