Question: Objectives Learn how to use the sizeof ( ) operator for various basic C data types. More practice with a makefile. Write a C program
Objectives
Learn how to use the sizeof operator for various basic C data types.
More practice with a makefile.
Write a C program called sizeof.c that uses the sizeof operator to print the number of bytes and number of bits the required for basic C data types on the ada server. Write a makefile to compile the C file. Show the number of bytes and bits required for the following C data types:
char
short
int
long
float
double
long double
void
The output from your program should look like this:
rchaney # sizeof
Size of basic C data types
sizeofchar byte bits
sizeofshort bytes bits
sizeofint bytes bits
sizeoflong bytes bits
sizeoffloat bytes bits
sizeofdouble bytes bits
sizeoflong double bytes bits
sizeofvoid bytes bits
The CFLAGS and LDFLAGS variables in the makefile should use these:
CFLAGS gWall Werror stdcpedantic
LDFLAGS lm nopie
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
