小编amc*_*amc的帖子

特殊使用C宏

阅读C库的套接字接口的代码,我发现了这个:

/* Types of sockets.  */
enum __socket_type
{
   SOCK_STREAM = 1,     /* Sequenced, reliable, connection-based
               byte streams.  */
#define SOCK_STREAM SOCK_STREAM
   SOCK_DGRAM = 2,      /* Connectionless, unreliable datagrams
               of fixed maximum length.  */
#define SOCK_DGRAM SOCK_DGRAM
...
Run Code Online (Sandbox Code Playgroud)

这个"成语"遍及bits/socket.h.我只是好奇,那些宏的目的是什么?

c enums preprocessor constants

6
推荐指数
1
解决办法
219
查看次数

标签 统计

c ×1

constants ×1

enums ×1

preprocessor ×1