/* * ====================================================================== * Print size of pointers (in bytes) for basic data types. * * Copyright (C) 1998 by Mark Austin and David Chancogne. * * This software is provided "as is" without express or implied warranty. * Permission is granted to use this software on any computer system, * and to redistribute it freely, subject to the following restrictions: * * 1. The authors are not responsible for the consequences of use of * this software, even if they arise from defects in the software. * 2. The origin of this software must not be misrepresented, either * by explicit claim or by omission. * 3. Altered versions must be plainly marked as such, and must not * be misrepresented as being the original software. * 4. This notice is to remain intact. * * Written by : Mark Austin * ====================================================================== */ #include /* for printf() prototype */ int main( void ) { char *cpChar; /* pointer of data type character */ int *ipVar; /* pointer of data type integer */ float *fpVar; /* pointer of data type float */ double *dpVar; /* pointer of data type double */ /* [a] : Print size of pointers for basic data types */ printf( "The sizeof \"cpChar\" is %d bytes\n", sizeof ( cpChar ) ); printf( "The sizeof \"ipVar\" is %d bytes\n", sizeof ( ipVar ) ); printf( "The sizeof \"fpVar\" is %d bytes\n", sizeof ( fpVar ) ); printf( "The sizeof \"dpVar\" is %d bytes\n", sizeof ( dpVar ) ); }