结构体

来源:互联网 发布:虚拟手机号码软件app 编辑:程序博客网 时间:2024/05/16 19:24

// 结构体声明:

typedef struct StructA{

int A;

int B;

} S_A, *a;


#include <stdio.h>

#include <string>

main()

{

    // 结构体清空:

    memset(a, 0, sizef(S_A));

   a->A = 10;

   a->B = 20;

    printf(%d,  a->A + a->B);

    return; 

}



注意:全局范围内,只能声明 和 初始化变量 ,          不可以运行赋值、做运算,执行函数


错误:expected constructor, destructor, or type conversion before '(' token




原创粉丝点击