1. VC参数为托管数组的函数用法.
定义一个 void OutputInformation(array <student^>^ Students);
函数主体:
void student::OutputInformation(array <student^>^ Students)
{
for(int i=0; i<5;i++)
{
OutputName(Students[i]);
OutputAge(Students[i]);
OutputEnglishScore(Students[i]) ;
OutputProgrammingScore(Students[i]) ;
}
}
void student::OutputName(student^ abc)
{
Console::Write("student Name: "+ Name);
Console::WriteLine();
}
void student::OutputAge (student^ abc)
{
Console::Write("Age: " + Age);
Console::WriteLine();
}
void student::OutputEnglishScore(student^ abc)
{
Console::Write("English Score: " + EnglishScore );
Console::WriteLine();
}
void student::OutputProgrammingScore (student^ abc)
{
Console::Write("Programming Score: " + student::ProgrammingScore );
Console::WriteLine();
}
引用函数
array <student^>^ Students = gcnew array<student^> (5) {Jack , Mike, John, Mok, Sophia};
OutputInformation (Students[5]);
网络上自己查