Eric, please stop using this mailing list to learn C++. If you have questions about G++ you can ask them here, but your questions are just about basic C++ and are not suitable on this list. On 2 June 2011 04:07, eric wrote: > after it run > ------------- > terminate called after throwing an instance of 'char const*' > Aborted > ----------this is better than Segmentation fault, but still not > expected------- It's because you throw a char*: throw("Push overflows stack"); You probably want to throw a bound_err: throw bound_err("Push overflows stack"); But again, please stop using this list to learn C++ If you are posting on comp.lang.c++ then stop repeating the posts here. Thanks.