了解TCanvas类中Textout函数

为什么只显示“姓名”中的姓和“分数”中的分?

了解TCanvas类中Textout函数_第1张图片

源代码:

__fastcall TfrmArrayExample::TfrmArrayExample(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TfrmArrayExample::FormPaint(TObject *Sender)
{
String name[3];
int score[3];
int x=20,y=20,total = 0;
float average;
name[0] = L'卡吗';score[0] = 93;
name[1] = L'等式';score[1] = 68;
name[2] = L'哦';score[2] = 74;

Canvas->TextOutW(x,y, L'姓名');
Canvas->TextOutW(x +100,y, L'分数');
for(int i = 0;i< 3;i ++)
{
Canvas->TextOutW(x,y+=20,name[i]);
Canvas->TextOutW(x+100,y,IntToStr(score[i]));
total += score[i];
}
average = total/3.0;
Canvas->TextOutW(x,y+=20,L'平均');
Canvas->TextOutW(x+100,y,FloatToStr(average));
}

求解


你可能感兴趣的:(了解TCanvas类中Textout函数)