Symbian 中的动态数组 CArrayX
2010-08-31 00:12:00 来源:WEB开发网_LIT(KFORMAT2,"id is %d");
_LIT(KFORMAT3,"score is %f");
for(TInt i=0; i
{
console->Printf(_L("name is "));
console->Printf((*StuArrayFlat)[i].iSName);
// 如果你觉得指针括号太多而不够美观,我们也可以使用另一种方法
// 即,使用At()函数
// 如:console->Printf(StuArrayFlat->At(i).iSName);
console->Printf(KRETURN);
console->Printf(KFORMAT2,(*StuArrayFlat)[i].iSNo);
console->Printf(KRETURN);
console->Printf(KFORMAT3,(*StuArrayFlat)[i].iScore);
console->Printf(KRETURN);
}
console->Printf(_L("Press any key to continue "));
console->Getch();
//删除数组中的元素
console->Printf(_L("Delete first Student "));
StuArrayFlat->Delete(0);
for(i=0; i
{
console->Printf(_L("name is "));
console->Printf((*StuArrayFlat)[i].iSName);
console->Printf(KRETURN);
console->Printf(KFORMAT2,(*StuArrayFlat)[i].iSNo);
console->Printf(KRETURN);
console->Printf(KFORMAT3,(*StuArrayFlat)[i].iScore);
console->Printf(KRETURN);
}
console->Printf(_L("Press any key to continuce "));
console->Getch();
//修改第一个学生的姓名
console->Printf(_L("Modify first student's name "));
console->Printf(_L("first student old name is "));
console->Printf((*StuArrayFlat)[0].iSName);
console->Printf(KRETURN);
(*StuArrayFlat)[0].iSName = _L("GuanYabei");
console->Printf(_L("first student new name is "));
console->Printf((*StuArrayFlat)[0].iSName);
console->Printf(KRETURN);
更多精彩
赞助商链接