Code:
#include <stdio.h>
struct Nsreq_accept {
int req_s;
};
struct Nsreq_shutdown {
int req_s;
int req_how;
};
union Nsipc {
struct Nsreq_accept accept;
struct Nsreq_shutdown shutdown;
};
union Nsipc* nsipcbuf;
struct Nsreq_accept* p;
struct Nsreq_accept accept = { 100 };
struct Nsreq_shutdown shutdown = { 1, 2};
void from_member_to_union() {
nsipcbuf = &accept;
printf("%d\n", nsipcbuf->accept.req_s);
}
void from_union_to_member() {
nsipcbuf = &shutdown;
p = nsipcbuf;
printf("%d\n", nsipcbuf->accept.req_s);
}
int main(int argc, const char *argv[]) {
from_member_to_union();
from_union_to_member();
return 0;
}
Output:
100
1
分享到:
相关推荐
社会科学领域解释与阐释的互补关系,黄微,,社会科学研究的目的旨在研究社会实体,而社会实体通常是以社会格式塔实体的形式存在的。这一社会格式塔实体不是传统意义上单纯的
本文档系统的从各个方面描述了频率响应和稳定性之间的关系
计算机视觉Github开源论文
随机递归最优控制问题的最大值原理和动态规划之间的关系及其应用,史敬涛,,本文研究随机递归最优控制问题的最大值原理和动态规划之间的关系,在一定可微性假设条件下,得到了对偶过程、广义哈密顿函数和值函�
The Relationship Between Precision-Recall and ROC Curves
①The relationship between formal education and economic growth in poor countries
Gaussion 分布下的 Hessian 矩阵和协方差的关系, 在 g2o 实现部分有关于为什么Hessian 矩阵等于 协方差矩阵的逆。
Relationship between the homotopy analysis method and harmonic balance method,陈衍茂,刘济科,The relationship between the homotopy analysis method (HAM) and harmonic balance (HB) method is studied....
Study on Relationship Between Network Public Opinion and New Function Mode of Ideological Education Based on Equations of Mathematical Physics
Relationship between creativity and classroom behavior RELATIONSHIP BETWEEN CREATIVITY AND CLASSROOM BEHAVIOR BRENDA G. STONE Texas A & M University A relationship between creativity and ...
Relationship between PPVT and WISC-R in children with reading disabilities P, I,,.h,,l,pj in rhr .Schnolr I W O , 1 7 , 331-333 RELATIONSHIP BETWEEN PPVT AND WISC-R IN CHILDREN WITH READING ...
The relationship between social behavior and self-concept in school settings Psychology in the Schools Volume 30, Oclobrr 1993 THE RELATIONSHIP BETWEEN SOCIAL BEHAVIOR AND SELF-CONCEPT IN SCHOOL...
企业柔性的影响因素及其与经营绩效之间的关系研究,齐鹏举,,本文根据理论研究成果,提出了相关假设,并问卷调查的基础上,使用结构方程模型、调节多元回归等方法对柔性的影响因素、柔性与企
Relationship between toy and material use and the occurrence of social interactive behaviors by normally developing preschool children RELATIONSHIP BETWEEN TOY A N D MATERIAL U S E A N D T H E ...
The relationship between achievement and IQ in students with learning disabilities Psychology in the Schools Volume 26, Ocrober 1989 THE RELATIONSHIP BETWEEN ACHIEVEMENT AND IQ IN STUDENTS WITH ...
侧链型偶氮苯均聚物的结构与全光极化行为的研究,郭斌,,本文对含有不同间隔基的偶氮苯均聚物聚(6-[4-(4-氰基偶氮苯) 苯氧基]乙基(己基)甲基丙烯酸酯)(PCN2,6)的全光极化行为 进行了
The relationship between metacognition and intelligence in normal adolescents: Some tentative but surprising findings PSychOIOgy in the Schools Volume 31. Apri l I994 THE RELATIONSHIP BETWEEN ...
The relationship between teacher and student anxiety levels TEACHER INSERVICE TRAINING IN CLASSROOM USE OF CONTINGENCY MANAGEMENT 231 HALL, R. V., LUND, D., & JACKSON, D. Effects of teacher ...
An unexpected relationship between failure and subsequent mathematics learning AN UNEXPECTED RELATIONSHIP BETWEEN FAILURE AND SUBSEQUENT MATHEMATICS LEARNING JOSEPH M. SCANDURA, JOAN BARKSDALE, ...
13.03.02 Analysis of the Relationship Between Alcott 's life experience and Jo March.doc