thatkaye / data-structures-and-algorithms

Data Structures and Algorithm
0 stars 0 forks source link

It seems your linked list has a memory error #12

Closed stensalweb closed 4 years ago

stensalweb commented 4 years ago

I typed delete: 30, and get this.

 Memory access error: dereferencing a non-pointer; abort!
  # Reading 4 bytes from an illegit address (0x4).
  # 
  # Stack trace (most recent call first) of the read.
  # [0]  file:/tmp/CSIT221/Linked List/list.c::239, 3
  # [1]  file:/tmp/CSIT221/Linked List/main.c::25, 9
  # [2]  [libc-start-main]
  https://cee.studio/explanation
thatkaye commented 4 years ago

Yes it would be an error because the 30 you mean is an item, the delete function asks for the position you want to delete. If it's not the case, please elaborate for me to make changes.

mlite commented 4 years ago

Perhaps, you can check to make sure 30 is an invalid position so it can be more robust. In the real world software used by many people, people do make mistakes. BTW, we are looking for students to test our new product -- It seems you write many C code, you must have experienced the cryptic segmentation faults. How long does it take you to figure it out?

thatkaye commented 4 years ago

I'll update the code right now, thank you. Anyway I can be one of the tester if you want.

mlite commented 4 years ago

how to use it online or on your computer?  https://www.cee.studio/students.html what benefits you can get? https://www.cee.studio/benefits.html

It's free for students and educators. Any feedback would be highly appreciated.

thatkaye commented 4 years ago

@stensalweb the code has been updated, it now prompts used if position exceeds the size.

thatkaye commented 4 years ago

@mlite I don't seem to get it yet, I tried adding an existing project and it does not ask me for inputs.

mlite commented 4 years ago

You can click Share to create a shareable link, describe what the problem is, and post them here. I can take a look tomorrow. It’s middle night here now.

On Oct 8, 2020, at 11:17 PM, dork.kaye notifications@github.com wrote:

@mlite I don't seem to get it yet, I tried adding an existing project and it does not ask me for inputs.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.