[Home]
[Edit this page]
[Recent Changes]
[Special Pages]
[Help]
QbasicFAQ_Errors » BCD_Format » CppVclMouse » Win32 API » TopUsers » DelphiFAQ » CppVclWindowMessage » runtime » midlevel » CppVclDialog » CppDeclaration
You do not need to include the argument names in the declaration, just their types. It is common to put function declarations in header files with extension .h and .hpp, whereas their definition is put in .cpp files.
The only function that cannot be declared is main()
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
QbasicFAQ_Errors » BCD_Format » CppVclMouse » Win32 API » TopUsers » DelphiFAQ » CppVclWindowMessage » runtime » midlevel » CppVclDialog » CppDeclaration
(C++) Function declaration
Specifying which arguments a function takes and what it returns. What the function preforms internally is specified in the definition.You do not need to include the argument names in the declaration, just their types. It is common to put function declarations in header files with extension .h and .hpp, whereas their definition is put in .cpp files.
double calculateSum(const std::vector<double>&);
The only function that cannot be declared is main()
Comparision to C
//C++ function taking no arguments void myFunction();
/* C function taking no arguments */ void myFunction(void);
Comparison to Prolog
A C++ declaratation is like a Prolog predicate//Function declarations in C++ void myFunction1() void myFunction2(const std::string&); void myFunction3(const std::string&, std::string&);
% Predicates in Prolog predicates myFunction1() myFunction2(string)- (i) % 'i' denotes input myFunction3(string,string)- (i,o) % 'o' denotes output
'Declaration' links
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
