开发学院手机开发Symbian 开发 Symbian 中的动态数组 CArrayX 阅读

Symbian 中的动态数组 CArrayX

 2010-08-31 00:12:00 来源:WEB开发网   
核心提示:_LIT(KFORMAT2,"id is %d");_LIT(KFORMAT3,"score is %f");for(TInt i=0; iCount(); i++){console->Printf(_L("name is "));console->

_LIT(KFORMAT2,"id is %d");

_LIT(KFORMAT3,"score is %f");

for(TInt i=0; iCount(); 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; iCount(); 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);

上一页  1 2 3 4  下一页

Tags:Symbian 动态 数组

编辑录入:coldstar [复制链接] [打 印]
[]
  • 好
  • 好的评价 如果觉得好,就请您
      0%(0)
  • 差
  • 差的评价 如果觉得差,就请您
      0%(0)
赞助商链接