Skip to main content

All Questions

0 votes
2 answers
60 views

CS50.h segmentation fault if memory is not allocated to string

While working on a CS50 problem set (substitution), I encountered a segmentation fault when running the code. After some searching I found out that assigning memory (malloc) to string "output&...
A.SALEH's user avatar
1 vote
4 answers
212 views

Segmentation fault (11) when using malloc inside a function to form a string

I'm trying to use a function to assign space and fill that space (or at least some of it) with characters to form a string. Within the function I make a call to malloc, and within the same function I ...
Motmot's user avatar
  • 121
1 vote
4 answers
1k views

Segmentation fault (core dumped) while performing strcat using pointers

I am relatively new to C. Now I know Segmentation fault appears when we try to use memory which we don't have access to. But I fail to find out where am I going wrong and would like to know. Any help ...
NirAv JaIn's user avatar
  • 1,075