Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /** ******************************************************** ***
- Hello heroseh, I noticed you did a thing a few minutes
- (30+) ago? I've done the same thing. I decided to look
- it up and see what I could find. CTRL+F on the spec
- didn't help, probably because I didn't know what I was
- looking for, but these stack overflow posts had
- information. Also did this example program for you.
- https://stackoverflow.com/questions/18820751/
- https://stackoverflow.com/questions/693788/
- Self: https://pastebin.com/2bMRsamk
- *** ******************************************************** **/
- /** ******************************************************** ***
- Type List:
- int sum(int,int); <------ declaration
- Parameter-Type list:
- int sum(int a , int b ); <------ declaration
- Parameter list:
- int sum( a , b ); <------ declaration
- *** ******************************************************** **/
- int f_1( ){ /** unspecified # args **/ return 1; }
- int f_2( void ){ /** no arguments. **/ return 1; }
- int f_3( int a ,...){ /** varadic function. **/ return a; }
- //: f_4: K&R Weirdness for declaring functions
- int f_4(a, b, c) //:<-- Parameter List
- int a;
- int b;
- int c;
- {
- return ( a + b + c );
- }
- #include <stdio.h>
- int main( void ){
- f_1( );
- f_1( 1 );
- f_1( 1 , 2 , 3 );
- f_2( );
- //: f_2( 1 ); //: too many arguments to function 'f_2'
- //: f_2( 1 , 2 , 3 ); //: too many arguments to function 'f_2'
- //: f_3( ); //: too few arguments fo function 'f_3'
- f_3( 1 );
- f_3( 1 , 2 , 3 );
- f_4( 1 , 2 , 3 );
- printf("[End_Of_The_World]\n");
- }
Add Comment
Please, Sign In to add comment