Function Definition/Declaration

In the Project Description it says FunctionDeclaration whereas in the ASTFactory the method is called createFunctionDefinition. Do they mean the same?

No, they are separate concepts.

A FunctionDeclaration declares that a function exists.

A FunctionDefinition actually contains the body of the function (and also declares the function, if that hasn’t been done before).

1 Like
int add (int, int); // declaration

int add(int a, int b) { // definition
    return (a + b);
}
1 Like