// VC6.cpp*: d�finit le point d'entr�e pour l'application console. // /clr #include "stdafx.h" #include #include #include #include #include "stdio.h" #include "stdlib.h" #include #include //#include using namespace std; using namespace System; FILE *fp1; //string ^str; std::string; //System::String^ str; //Variable char * prt_info2; int i,nb_step_Y,nb_step_X,j,k,cc,dd,n; long recl,lenr,numf,numx,numy; float xmin,xmax,ymin,ymax; //MAX=100; //Struct //typedef struct { //float abscisse; //float ordonnee; //} tPoint; //float X,Y,Z,A,B,C,F; struct info{ float *X; float *Y; float *Z; float *A; float *B; float *C; float *F; }; info info2,bar,juju; int main() { String ^str; int num_rec = 0; pin_ptr wch = PtrToStringChars(str); // Convert to a char* size_t origsize = wcslen(wch) + 1; const size_t newsize = 1000; size_t convertedChars = 0; char nstring[newsize]; wcstombs_s(&convertedChars, nstring, origsize, wch, _TRUNCATE); //strcat_s(nstring, " (char *)"); errno_t err; //Read from data file if((err=fopen_s(&fp1,"C:\\Sample\\project2DAT.dat","rb"))!=0) fread(&recl,sizeof(recl),1,fp1); lenr=recl/256/4; fseek(fp1,28+24,0); fread(&numf,sizeof(numf),1,fp1); fseek(fp1,3*28+16,0); fread(&ymin,4,1,fp1); fread(&ymax,4,1,fp1); fread(&numy,4,1,fp1); fseek(fp1,4*28+16,0); fread(&xmin,4,1,fp1); fread(&xmax,4,1,fp1); fread(&numx,4,1,fp1); for (long i=0;i<2;i++) { fread(&info2.X[i],4,1,fp1); fread(&info2.Y[i],4,1,fp1); fread(&info2.Z[i],4,1,fp1); fread(&info2.A[i],4,1,fp1); fread(&info2.B[i],4,1,fp1); fread(&info2.C[i],4,1,fp1); fread(&info2.F[i],4,1,fp1); } fclose(fp1); //build the step for smaller grid nb_step_Y=(int)ymax-(int)ymin; nb_step_X=(int)xmax-(int)xmin; //build the array with the lines by smaller grid cc=0; for (long j=0;j