O'Reilly logo

Just Enough C/C++ Programming by Guy W. Lecky-Thompson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Code Sample 3.2: Simple Skeleton Application

You now have enough information at your fingertips to create a simple program—one that compiles and can be run. It might not do anything, but just being able to get something to compile is often an achievement in itself.

To give you a fighting chance, however, I’ll define a simple skeleton application that fulfills this criterion.

The following might be used as a starting point for C applications—it is well behaved and contains enough components to be useful. It does nothing except return a non-error value at present, but it does give you a good platform upon which to build future programs.

int g_nReturnValue; // An integer variable void SetDefaultReturnValue() { g_nReturnValue = 0; // Set to a non-error ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required