数组实参-Tips


void  Func1( char  str[])
{
    cout
<< sizeof (str) << endl;
    cout
<< strlen(str) << endl;
    cout
<< str << endl;
}

void  Func2( char   * str)
{
    cout
<< sizeof (str) << endl;
}

void  Func3( int  ( & )[ 6 ]);
void  Func3( char  ( & str)[ 6 ])
{
    cout
<< sizeof (str) << endl;
    cout
<< str << endl;
}


int  _tmain( int  argc, _TCHAR *  argv[])
{
    Func1(str);
    Func2(str);
    Func3(str);

    getchar();
    
return   0 ;
}

posted on 2011-08-09 00:14 Vcer-JZ 阅读(196) 评论(0)  编辑 收藏 引用 所属分类: VC


只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理


导航

统计

随笔分类

随笔档案

搜索

最新评论