Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

C and C++ Question

Name: Anonymous 2008-10-09 18:17

Why must you declare functions twice?

Name: Anonymous 2008-10-09 22:39

>>1
Wrong. You only have to declare a function one, and define it once. Declarations go in header files, definitions in source files. A prototype is the most common form of declaration, but for functions that are only used in one file, a definition can double as a declaration.

Declaration: void foo();
Definition:  void foo() { }
Declaration and Definition (assuming no other conflicting declarations): void foo() { }

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List