for deleteall i want it to just delete all of the nodes then printout zero, but it just printsout the full numbers. any idea how to fix that, then also there is the problem that i get a memory printout when i printout the random numbers. any help is appreciated
here is the output
startlist() 4318456 549 604 986 944 712 283 556 734 286 861
Insert Node (Y/N)? y
Node# =
3
Value = 333
4318456 549 333 604 986 944 712 283 556 734 286 861
List size = 12
Change Value (Y/N)? y
Node# = 2
Value = 222
222 549 333 604 986 944 712 283 556 734 286 861
List size = 12
Delete Node (Y/N/ALL)? a
Deleting Nodes 222 549 333 604 986 944 712 283 556 734 286 8
61
List size = 12
Complete
as you can see, i just want all the nodes to delete and the list size to equal zero. above that i have the memory being pritned out.
that format isn't easy to read. Does your code always look like that?
You want to manipulate 'start' directly so you have to write instead of void deleteNode(nodetype *start, int pos) -> void deleteNode(nodetype **start, int pos) Note that second '*' (like in 'startlist')
What's this line all about nodetype *d = new nodetype;? new in delete?
So that you use always 'pos' it doesn't look like you want a single linked list? Using vector might probably be easier for your purpose