|
Unknown
Join Date: Apr 2008
Location: unknown
Posts: 87
Rep Power: 1 
|
sizeof question
in line 26
assert(maxIdFun==sizeof FunctionArray/sizeof FunctionArray[0])
what is the size of functionArray and size of functionArray[0] i cant understand that... and how come it would equal to maxIdFun... and the point of dividing it
const int maxIdFun=14; FunctionEntry FunctionArray [] = { log, "log", log10,"log10", exp, "exp", sqrt, "sqrt", sin, "sin", cos, "cos", tan, "tan", CoTan,"cotan", sinh, "sinh", cosh, "cosh", tanh, "tanh", asin, "asin", acos, "acos", atan, "atan", }; FunctionTable::FunctionTable(SymbolTable& symTab,FunctionEntry* funArr) :_size(0) { assert(maxIdFun==sizeof FunctionArray/sizeof FunctionArray[0]) for(int i=0; i<maxIdFun; ++i) { int len=strlen(funArr[i].strFun); if(len==0) break; _pFun[i]=funArr[i].pFun; cout<< funArr[i].strFun<<endl; int j=symTab.ForceAdd(funArr[i].strFun,len); assert(i==j); ++_size; } }
thanks a lot
__________________
-------------------------------------------------------------------------
I thought what I'd Do was, I'd pretend to be one of those deaf mutes
------------------------------------------------------------------------
|