问题
单项选择题
以下程序在VC6平台上编译运行,程序运行后的输出结果是
#include<stdio.h>
main()
int s, t, A=10; double B=6;
s=sizeof(A); f=sizeof(B);
printf("%d, %d\n", s, t);
A) 2,4
B) 4,4
C) 4,8
D) 10,6
答案
参考答案:C
解析: VC6中,存储int型、long型变量占用4个字节,存储float型变量占用4个字节,存储double型变量占用8个字节。