You are browsing as a guest. Sign up (or log in) to start making projects!

Open comments for this post

3h 46m 8s logged

FINALLY FIXED SEGMENTATION PROBLEMS

For context i was building the compressor and i had segmentation problems

What is a segmentation problem?

A segmentation problem is when you try and access memory your don’t have access.

What was the problems?

  • First the allocation, i didnt allocate for the array of pointers to my struct.
  • Didnt check for NULL, so my arrays have 256 nodes (for all of the ASCII values) and i was trying to access values that just didnt existed.

How did i fix it?

I used AI to debug my code, I didnt directly asked for the awnsers, i asked it to help me without giving out awnsers. AI was very useful since i mad alot of small mistakes since i didnt program in C for a long time.

0
1

Comments 0

No comments yet. Be the first!