Posted 18 November 2012 - 11:10 PM
The code as presented will not compile, L has not been declared in main(). If your intention was the "list *L" line. then the reason it crashes is because you have not allocated space for the list which L should point to... you need a malloc (and a free) somewhere.
This is really C code with an cout thrown it, btw, not really C++.