#include #include using namespace std; char decl[101]; //int val[1001]; char type[101]; int getType(char type[]) { if(!strcmp(type, "int")) return 4; if(!strcmp(type, "short")) return 2; return 1; } int getVal(char* & start) { //int i=0; int total=1; int val; //len=strlen(start); while(start[0]!='\0' && start[0]!=',') { if(start[0]=='[') { val=0; start++; while(start[0]!=']') { val=val*10+start[0]-'0'; start++; } total*=val; } start++; } start++; return total; } int compute(char decl[]) { int len=strlen(decl); char* start; int i=0; int typevalue; int total=0; while(i