- 論壇徽章:
- 0
|
C語言的雙目操作符 ##
php 源碼里到處可見《C語言教程》上這么寫:
雙目操作符“##”用于合并標記。下面是一例
#define X(i) x ## i
X(1) = X(2) = X(3);
經(jīng)過預處理器處理之后,它變成下面這行代碼:
x1 = x2 = x3;
再看php源碼
# define ZEND_MM_LONG_CONST(x) (x##i64)
#define ZEND_MM_TYPE_MASK ZEND_MM_LONG_CONST(0x3)
下一行宏應該解釋為:?
#define ZEND_MM_TYPE_MASK ox3[color="#ff0000"]i64 [color="#009900"]/*暈倒*/
#include stdio.h>
#define X(x) (x##64) /*不加i就沒事*/
#define Y X(0x3)
void main(){
printf("%d",Y);
getch();
}
![]()
文件:
(M)2007-8-22.rar
大小:
73KB
下載:
下載
keywords:GUID,Lex&Yacc,ARM,PECL,foo,bar
1.guid:global unique identifier;
解讀php source:function php_logo_guid(),uniqid,mt_rand,
生成guid的php class guid.class.php
---php_logo_guid()分析 ?=PHPE9568F34-D428-11d2-A769-00AA001ACF42
standard/info.h
#define PHP_LOGO_GUID "PHPE9568F34-D428-11d2-A769-00AA001ACF42"
PHPFUNCTION(php_logo_guid);
standard/info.c
PHP_FUNCTION(php_logo_guid) /*line:1082*/
2.get_defined_constants();
3.GLOBALS
調(diào)試是把 2.3.通通print_r出來
寫得有點亂,大概了解了這些,不知道自己的路走得對不對,不過C是肯定要上的,知道點‘底層’的運行機制做起事來確實爽得多。2007/8/24-25
![]()
文件:
2007-8-24.rar
大小:
138KB
下載:
下載
本文來自ChinaUnix博客,如果查看原文請點:http://blog.chinaunix.net/u/10152/showart_365520.html |
|