首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 操作系统 >

Code demostrating "Distinguishing C++ Declarations from Expressions"

2012-12-19 
Code demostrating Distinguishing C++ Declarations from ExpressionsCode demostrating Distinguishi

Code demostrating "Distinguishing C++ Declarations from Expressions"

Code demostrating "Distinguishing C++ Declarations from Expressions" in?The Definitive ANTLR Reference.

?

#include <stdio.h>typedef int I;char x = 'a';void foo() {  I(x);  x = 10;  printf("x = %d in foo\n", x);}struct _node {  int m;};typedef struct _node * T;T(*a)(int);int main(int argc, const char *argv[]) {  printf("cast %d, %d\n", I(x), (I)x);  foo();  printf("x = %d in main\n", x);   struct _node n;  T one = &n;  T *a = &one;  T(*a)->m = 8;  printf("m: %d\n", (*a)->m);  return 0;}
?

热点排行