多选题

What’s the output of&n...

发布于 2022-03-03 17:31:27

What’s the output of below code on a 64-bit system?(单选)

#include <iostream>
using namespace std

struct data {
int type

struct {
    unsigned int a:1
    unsigned int b:1
    unsigned int c:4
    unsigned int d:4
    unsigned int e:4
    unsigned int f:4
    unsigned int g:4
    unsigned int h:8
    unsigned int i:8
} flags

struct {
    unsigned int a:1
    unsigned int b:1
} flagsEx
}

int main() {
    data temp
    int a = sizeof(data)
    int b = sizeof(temp)

    data *pTemp = new data()
    int c = sizeof(pTemp)
    delete pTemp
    pTemp = NULL

    cout << a << ", " << b << ", " << c << endl

    return 0
}

登录后免费查看答案
关注者
0
被浏览
14
知识点
面圈网VIP题库

面圈网VIP题库全新上线,海量真题题库资源。 90大类考试,超10万份考试真题开放下载啦

去下载看看