Answers to questions on function declarations

What is wrong with the following function declarations?
  1. out2(char * s1, char * s2)
    {
       printf("%s\n%s",s1,s2);
    }
    
    The function has no return type specified. It should be of type void.

  2. void addup(int v1, int v2)
    {
       int v3;
       v3 = v1 + v2;
       return v3;
    }
    
    The function returns a value even though it is declared as of type void.

Back to the questions.


Back to notes on function declarations.