I see the terms "declaration," "prototype" and "symbol" thrown around interchangeably a lot when it comes to code like the following:

void MyUndefinedFunction();

The same goes for "definition" and "implementation" for things like this:

void MyClass::MyMethod()
    // Actual code here.

Are there any distinctions between the terms, or are they truly synonymous?

EDIT: I'm unsure whether or not this belongs on Stack Overflow...

2 Answers 2


In C, they are different.

A "symbol" is the name of a variable, constant, or function, e.g. i, sqrt, or value.

A "declaration" indicates that the given variable, constant, or function exists, and tells its type, e.g.

const int i;
double sqrt();
float value;

A "prototype" provides information about the arguments to a function as well as its return type, e.g.

double sqrt(double value);
  • Another term for "prototype" in this context is a method signature. Commented May 2, 2011 at 2:05

Declarations are simply the act of declaring a variable into existence. The definition is what a variable is holding, or the code that a function will execute.

void MyUndefinedFunction(); is a prototype because it's not being defined to do anything (it is being declared). Implementing a variable or function would be the act of using it, or implementing it into your code, to accomplish a task.

void MyFunction(); // The function prototype

void MyFunctoin() {

// The code to be executed by MyFunction() (the definition)


if (something happens) {

MyFunction() // The implementation of the function into your program

  • When you say declaring into existence, that formulation seems suggests that a declaration like extern int foo; makes the variable exist (I know that this is not what you mean). But it does not, it lets the compiler know that this variable does exist but it doesn't make it exist. extern int foo; does not cause any memory to be allocated to hold an int (which is what I think of by "existing". The declaration is only information about the existence of something. Sorry if I'm being too pedantic. Commented Jun 18, 2020 at 17:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.