当前位置:网站首页 > 技术博客 > 正文

contain_of宏



#include <stddef.h>
#include <stdio.h>

struct

address

{

char

name

[ 50 ] ;

char

street

[ 50 ] ;

int

phone

;
} ;


int

main

( )
{

printf ( "address 结构中的 name 偏移 = %d 字节。 " ,

offsetof ( struct

address

,

name

) ) ;


printf ( "address 结构中的 street 偏移 = %d 字节。 " ,

offsetof ( struct

address

,

street

) ) ;


printf ( "address 结构中的 phone 偏移 = %d 字节。 " ,

offsetof ( struct

address

,

phone

) ) ;

return ( 0 ) ;
}

  • 上一篇: 双向链表的示意图
  • 下一篇: jsoncpp rapidjson
  • 版权声明


    相关文章:

  • 双向链表的示意图2025-05-23 10:01:00
  • c++中的typedef关键字2025-05-23 10:01:00
  • scanf在c语言中如何使用2025-05-23 10:01:00
  • sscom3.3串口使用说明2025-05-23 10:01:00
  • hikaridatasource连接池2025-05-23 10:01:00
  • jsoncpp rapidjson2025-05-23 10:01:00
  • 运维监控系统有哪些2025-05-23 10:01:00
  • 什么叫指针数组2025-05-23 10:01:00
  • 如何设计一个高并发高可用系统2025-05-23 10:01:00
  • c++多线程调用python2025-05-23 10:01:00