數(shù)組實(shí)參-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 ;
}
{
????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 閱讀(227) 評(píng)論(0) 編輯 收藏 引用 所屬分類: VC