0 votes
1 view
in C Programming by (46.8k points)
recategorized by

Can anyone tell me what is Segmentation fault in C?

1 Answer

0 votes
by (110k points)

In C programming, a segmentation fault is a type of error caused if you try to access memory that “does not belong to you.”

When your code tries to perform read and write operation in a read-only location in memory or freed block of memory, this segmentation fault occurs.

 Common Segmentation fault scenarios:

  • Modifying a string Literal
  • Trying to access an address that is freed
  • Accessing out of array index bounds
  • Improper use of scanf()
  • Stack Overflow
  • Dereferencing uninitialized pointer

If you want to learn C programming, then check out this C Certification program by Intellipaat.

Also, watch this YouTube tutorial on C programming:

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...