How to assing string value?

I created my own list (template) and I want to assing string value, but I got error in file "SuperList.h" line 24. Why is that?

main.cpp
http://pastebin.com/Ap8hAvM6

SuperList.h
http://pastebin.com/fR2g41HF
Looks like it compiles but crashes at runtime:
http://ideone.com/AEON4H
Exactly, it cant assing string at line 24 inside SuperList.h.

But it works fine with int.
In the constructor you forgot to initialize capacity and in the add function you allocate cnt+2 elements instead of using capacity.
Topic archived. No new replies allowed.