怎么以可视化的方式打开一个数据文件并画出图形?
FILE *stream,*stream1;
char FirstLine[512];
OpenDialog1->Options.Clear();
OpenDialog1->Options << ofAllowMultiSelect << ofFileMustExist;
OpenDialog1->Filter = "Text files (*.txt)|*.txt|All files (*.*)|*.*";
OpenDialog1->FilterIndex = 2; // start the dialog showing all files
if (OpenDialog1->Execute())
{
for (int I = 0; I < OpenDialog1->Files->Count; I ++)
{
stream = fopen(OpenDialog1->Files->Strings[I].c_str(), "r");
if (stream)
{
// read the first line from the file
fgets(FirstLine, sizeof(FirstLine), stream);
Memo1->Lines->LoadFromFile(OpenDialog1->FileName);
}
}
}
//char str[481];
float pi,xx,yy,x[481];
int i,j,ll,k;
pi=M_PI;
ll=24;
xx=0.0;yy=0.0;
for(i=1;i<=2*z;i++)
x[i]=0;
circul=998.655396/2;
for(i=0;i<Memo1->Lines->Count;i++)
{
char *str = new char[Memo1->Lines->Count];
StrPCopy(str,Memo1->Lines->Strings[i]);
x[i]=(float) str[i];
x[i]=x[i]+998.655396;
Series2->AddY((x[i]+998.655396),"",clBlue);
}
为什么str数组的值不能传到x[i]中呢?