Click Here for the snapshot of my problem.

    string operand;
    string opCode;

   struct MacroNameTable{
       string macroName;
       int start;
       int end;
       int invocation; 
       string operandCounter;      
       };

struct MacroNameTable NAMTAB[NAMSize];  

      void addNAMTab(){
            NAMcounter++;
            cout <<"check NAMcounter: ["<<NAMcounter<<"]"<<endl;//debug
            cout <<"check this operand: ["<<operand<<"]"<<endl;//debug
            cout <<"check this opCode: ["<<opCode<<"]"<<endl;//debug

            NAMTAB[NAMcounter].macroName=opCode;
            NAMTAB[NAMcounter].start=DEFcounter;
            NAMTAB[NAMcounter].operandCounter="AA";
        }

operand and opCode will read from text file. As you can see from the snapshot, after read from file,
current operand="&INDEV, &BUFADR, &RECLTH"
current opCode="RDBUFF"

this line cause a problem , it gives me runTime error

NAMTAB[NAMcounter].macroName=opCode;

but if i change to

 NAMTAB[NAMcounter].macroName=operand;

then it is working again. Click Here

why ?? I've debug whole day long and I still cannot solve this, it supposed to be working because opCode is string , so does NAMTAB[NAMcounter].macroName

This question has already been answered. Start a new discussion instead.