Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - How to design a program that outputs the number of bytes occupied by integer and character types in memory?
How to design a program that outputs the number of bytes occupied by integer and character types in memory?
Generally, plastic accounts for 4 bytes, and character type accounts for one byte. You can use sizeof query.

int a;

char b;

int n = sizeof(a);

int m = sizeof(b);