摘要:
函数名跟数组名一样,都是地址。数组名是首元素的地址,函数名是函数入口处地址。比如一个函数名为 fun;cout<<fun<<endl; 在VS翻译器下可以正确输出为地址,在GCC编译器下会输出为 1,只需要 cout<<(void *)fun<<endl; 即可。#include <iostream>using namespace std;void print_x(int i){ cout<<"x: "<<i<<endl;}void print_y(int i){ cout< 阅读全文
posted @ 2012-11-30 17:17
轻典
阅读(203)
评论(0)
推荐(0)