偷偷說一下,那帖子只是後段的處理,我現在是要重寫前段。
後段是純Ascii Code,但是前段是要讀Binary Code轉成Ascii Code,再將數據做基本的結構化。
不要選我當版主
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <windows.h> #include <time.h> #include <io.h> #define Max_Size 256 #define FOREGROUND_WHITE (FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY) int FlowCount=100,SubCount=50,SiteNum=4,PinCount=20; struct PinInfo { char PinName[Max_Size]; char PinPoF[1]; float LO_LIMIT; float HI_LIMIT; float LO_SPEC; float HI_SPEC; float PinResult; char UNITS[1]; }; struct BIN { short int SoftBin; short int HwardBin; }; struct IC { PinInfo *ICData; char ItemType[1]; int PinNum; int PinTestTime; int ICNumber; short int X; short int Y; }; struct Site { IC *SiteData; int SiteCount; BIN *SiteBin; char SubTestName[Max_Size]; }; struct SubTest { Site *SubTestData; int SubTestNumber; }; struct Flow { SubTest *FlowData; int FlowNumber; }; void InitPinInfoStruct(PinInfo *Pin) { Pin->HI_LIMIT = 0.0 ; Pin->HI_SPEC = 0.0 ; Pin->LO_LIMIT = 0.0 ; Pin->LO_SPEC = 0.0 ; memset(Pin->PinName,0,sizeof(Pin->PinName)); memset(Pin->PinPoF,0,sizeof(Pin->PinPoF)); Pin->PinResult = 0.0 ; memset(Pin->UNITS,0,sizeof(Pin->UNITS)); } void InitICStruct(IC *ic) { ic->ICData = new PinInfo[Max_Size]; InitPinInfoStruct(ic->ICData); memset(ic->ItemType,0,sizeof(ic->ItemType)); ic->ICNumber = 0 ; ic->PinNum = 0 ; ic->PinTestTime = 0 ; ic->X = 0 ; ic->Y = 0 ; } void InitBINStruct(BIN *bin) { bin->HwardBin = 0 ; bin->SoftBin = 0 ; } void InitSiteStruct(Site *SN) { SN->SiteData = new IC[Max_Size]; InitICStruct(SN->SiteData); SN->SiteBin = new BIN[Max_Size]; InitBINStruct(SN->SiteBin); SN->SiteCount = 0 ; memset(SN->SubTestName,0,sizeof(SN->SubTestName)); } void InitSubTestStruct(SubTest *SubT) { SubT->SubTestData = new Site[SiteNum]; InitSiteStruct(SubT->SubTestData); SubT->SubTestNumber = 0 ; } void InitFlowStruct(Flow *Project) { Project->FlowData = new SubTest[SubCount]; InitSubTestStruct(Project->FlowData); Project->FlowNumber = 0 ; } void main(int argc, char* argv[]) { Flow *ProjectD = new Flow[FlowCount]; InitFlowStruct(ProjectD); }
struct PinInfo { char PinName[Max_Size]; char PinPoF[1]; float LO_LIMIT; float HI_LIMIT; float LO_SPEC; float HI_SPEC; float PinResult; char UNITS[1]; }; struct BIN { short int SoftBin; short int HwardBin; }; struct IC { PinInfo **ICData; //二維 char ItemType[1]; int PinNum; int PinTestTime; int ICNumber; short int X; short int Y; }; struct Site { IC **SiteData; //二維 int SiteCount; BIN **SiteBin; //二維 char SubTestName[Max_Size]; }; struct SubTest { Site **SubTestData; //二維 int SubTestNumber; }; struct Flow { SubTest **FlowData; //二維 int FlowNumber; }; .... void InitFlowStruct(Flow *Project)//从这开始就不会了.. { Project->FlowData = new SubTest*[SubCount]; for(int i=0;i<FlowCount;i++) { FlowData[i] = new SubTest[SubCount]; //InitSubTestStruct(Project->FlowData); } Project->FlowNumber = 0 ; } void main(int argc, char* argv[]) { Flow **ProjectD = new Flow*[FlowCount]; for(int i=0;i<FlowCount;i++) { ProjectD[i] = new Flow[FlowCount]; InitFlowStruct(ProjectD[i]); } }