#include <stdio.h>
int main()
{
short int a;
char c;
printf("%d %d %d",sizeof(a),sizeof(c),sizeof(c+a));
}
4字节而不是在该函数sizeof一个是炭的2字节大小为1个字节,但我把它们加起来它给4字节。它在表达式中做了什么来使其成为4
我不是在寻找一个恒定的记录最大值可用int代表;我正在寻找一个int可以占用的最大内存量。请看下面的代码: import sys
def print_and_execute(*args):
for s in args:
print(s, end = " == ")
r = eval(s)
print(r)
return
print_a
/**** Program to find the sizeof string literal ****/
#include<stdio.h>
int main(void)
{
printf("%d\n",sizeof("a"));
/***The string literal here consist of a character and null character,
产生的数据类型,我被人比我更了解的是,sizeof操作符不产生类型“为size_t”的值,而是产生具有相同的基本类型“为size_t”的值告诉。虽然这可能是比语义技术性罢了,C++ 11 5.3.3.6和C++ 14 5.3.3.6双方声明如下: The result of sizeof and sizeof... is a constant of type std::size_t.
[ Not