Bruce Eckel's Thinking in C++, 2nd Ed | Contents | Prev | Next |
//: C03:Declare.cpp // Declaration & definition examples extern int i; // Declaration without definition extern float f(float); // Function declaration float b; // Declaration & definition float f(float a) { // Definition return a + 1.0; } int i; // Definition int h(int x) { // Declaration & definition return x + 1; } int main() { b = 1.0; i = 2; f(b); h(i); } ///:~
#include <stdio.h> #include <stdlib.h>
#include <cstdio> #include <cstdlib>