This is a linked list and I get a segmentation error, what am I doing wrong?

后端 未结 0 1932
误落风尘
误落风尘 2021-01-30 10:46

Let me know if i need to post the entire code here thank you for your help.

int sum_LL(node* ptr) {

int ret = 0;

while(ptr) {

ret += ptr->val;//segmentation         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题