Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - sizeof has three grammatical forms, as follows:
sizeof has three grammatical forms, as follows:

int

i;

Here int is an integer, which is a type,

i is a variable, which is an object

< p>sizeof(

i

);

//

ok

=》Based on 1)

sizeof(

object

);

//

sizeof(

Object

);

sizeof

i;

//

ok=》Basic

p>

3)

sizeof

object;

//

sizeof

object< /p>

sizeof(

int

);

//

ok=》Based on

< p>2)

sizeof(

type_name

);

//

sizeof(

Type

);

sizeof

int;

//

error< /p>

=》Because sizeof without parentheses in C language will directly recognize int as a variable, so an error will occur