home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C by Discovery (4th Edition)
/
C_By_Discovery_4th_Edition.tar
/
C_By_Discovery_4th_Edition
/
_DISK_
/
ch7
/
la16.c
< prev
next >
Wrap
C/C++ Source or Header
|
2005-06-16
|
703b
|
31 lines
/* la16.c
*
* Synopsis - Displays the sizeof() a structure and
* the values of two pointer arithmetic
* expressions.
* Objective - To provide practice with pointer
* arithmetic with pointers to structures.
*/
/* Include Files */
#include <stdio.h>
/* Constant Definitions */
#define ID_SIZE 8
/* Type Descriptions */
struct auto_part {
char id[ID_SIZE];
double price;
int cur_inv;
} part;
int main( void )
{
struct auto_part * partptr = ∂
printf( "sizeof( part ) %d\n", sizeof( part ) );
printf( "partptr %d, partptr+1 %d\n", partptr, partptr+1);
return 0;
}