Posted: 10/11/2011 3:19:13 AM EDT
|
It's been a while, but you're only allocating 0 bytes on the heap (p = new char[n]) as you have n set to 0.
If you attempt to write anywhere in p (ie p[j] = '*') you'll get an access violation. That being said, I'm not sure I fully understand what you're shooting for here. |
