cppannotations/yo/intro/type.yo
fbbrokken 6881bc3814 The trunk directory contains the latest version (6.4.0c) of the C++
Annotations. 

The branches and tags directory are empty, since I couldn't
svnadmin import a repostitory dump. Many earlier versions exist, though, and
if you want the full archive, just let me know and I'll send you the svnadmin
dump of my full C++ Annotations archive.

Frank B. Brokken <f.b.brokken@rug.nl>



git-svn-id: https://cppannotations.svn.sourceforge.net/svnroot/cppannotations/trunk@3 f6dd340e-d3f9-0310-b409-bdd246841980
2006-09-04 08:26:34 +00:00

26 lines
981 B
Text

bf(C++) uses very strict i(type checking). A prototype must be known for each
function before it is called, and the call must match the prototype.
The program
verb(
int main()
{
printf("Hello World\n");
}
)
does often compile under bf(C), though with a warning that ti(printf()) is
not a known function. Many bf(C++) compilers will fail to produce code in such
a situation. The error is of course the missing ti(#include <stdio.h>)
directive.
Although, while we're at it: in bf(C++) the function ti(main()) em(always)
uses the tt(int) i(return value). It is possible to define ti(int main())
without an i(explicit return) statement, but a ti(return) statement without an
expression cannot be given inside the tt(main()) function: a tt(return)
statement in tt(main()) must always be given an tt(int)-expression. For
example:
verb(
int main()
{
return; // won't compile: expects int expression
}
)