[Home]
[Edit this page]
[Recent Changes]
[Special Pages]
[Help]
mouse » CppRunTimeError » CDefinition
Opposite of a declaration:
Variables need to be defined first at the top of every function using them.
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
mouse » CppRunTimeError » CDefinition
(C) Definition
Specifying the value of a ?variable or specifying the body of a function.Variable definition
Setting the value of a variable:const int value = 3;
Opposite of a declaration:
int declaredValue; //Just a declaration, can be any value
Variables need to be defined first at the top of every function using them.
Function definition
Specifying the internals of a function, instead of declaring the function's arguments and return type. Function definitions are mostly found in .c files.
/* TODO: Make C example
double calculateSum(const std::vector<double>& myVector)
{
double sum = 0.0;
const int size = myVector.size();
for (int i=0; i!=size; ++i)
{
sum+=myVector[i];
}
return sum;
}
- /
'Definition' links
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
