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...


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);
| improve this answer | |
  • Another term for "prototype" in this context is a method signature. – Mike Rosenblum May 2 '11 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

| improve this answer | |
  • 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. – Philippe Carphin Jun 18 at 17:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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