there is some problem in reverse function, can someone help
Segmentation fault
Hello @akshatkaush,
-
There are so many silly mistakes in your code.
a) missed defining the data type of variables
b) missed semicolon
c) data type with wrong type -
The logic for creating the linked list is wrong.
-
The logic for reverse is wrong.
Refer to the comments for better understanding:
https://ide.codingblocks.com/s/213561
As there is a need to change the entire code, so I am sharing mine with you:
Suggestion:
Please go through all the videos of linked again.
No need to rush.
Understand the concepts properly including all the basics.
I am saying this for your benefit only.
Hope, this would help.