INF: Old Style Declarations Are Not Supported in C++

ID Number: Q79845

MS-DOS

Summary:

The Microsoft C/C++ Compiler version 7.0 does not support Old Style

function declarations in C++ files. Old Style declarations are still

supported in C files.

More Information:

Old Style declarations, sometimes called K&R declarations, are

declarations in which there are no parameters listed inside the

parentheses. For example:

void KRfunc();

int a;

char b;

C++ requires ANSI-style function prototypes (or declarations), which

list the type of each parameter accepted by the function, as shown

here:

void ANSIfunc(int a, char b);

This type of declaration is required because in C++ each function has

a signature. The signature consists of the name of the function and

the types of the parameters it accepts. The compiler cannot construct

the signature of a function from the K&R declaration.

Additional reference words: 7.00