http://pastesrc.com/view/JbIfLyTVbu

I've been looking over the Web, but cannot seem to get it to work...

The code you've linked to doesn't compile due to undeclared variables. Could you post the updated code which produces a segfault here, please?

You are making a some mistakes with pointers.

Don't use delete[] elemento but delete elemento
Don't use delete[] prossimo but delete prossimo

You can not write something like delete pun[i]; because pun is not an array.

Declare the variables n and m.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.