when i compile this there isnt any errors, but at runtime it say "memory could not be read".Code:for(int x=0;x<5;x++) { char * strVal; strVal = new char[4]; sprintf(strVal, "%s%d%g", '<', x, '>'); cout<<strVal<<endl; delete[] strVal; }
any ideas how to fix this problem. Thanks




Reply With Quote