Skip to main content

All Questions

-1 votes
2 answers
122 views

Why am I getting a segmentation fault? C, basic code

Why I am getting a segmentation fault? Unlike other similar questions posted here, it doesn't seem to me that I'm trying to access an array index that is out of memory. What I want the squeeze(char s1[...
superslime16th's user avatar
-1 votes
5 answers
91 views

unite two strings by copying one by one the characters of the second at the end of the first

this program it suppose to print Hello World but guess what exited, segmentation fault why is that happening ? #include <stdio.h> #include <string.h> char f(char *a, char *b) { int i ...
Thodoris Ampas's user avatar
2 votes
0 answers
36 views

Why am I getting a segmentation fault (core Dumped) in a program to encrypt string? [duplicate]

I'm currently learning C programming. This is the C code to encrypt a string. #include <stdio.h> #include <stdlib.h> void encrypt(char *message){ // Here message is a character ...
technextgen's user avatar
0 votes
1 answer
106 views

Unknown Segmentation fault (core dumped) in C program

I am writing a program that splits a sentence and returns an array of strings of the individual words in the sentence. I have written the two functions below but when I run them I get a Segmentation ...
Brandon's user avatar
1 vote
2 answers
73 views

Segmentation Fault accessing string in another function [duplicate]

It can be a rookie mistake however I am not able to point out reason for this Segmentation Fault. Below is the code : #include <stdlib.h> #include <stdio.h> #include <string.h> ...
Prithi's user avatar
  • 57
1 vote
2 answers
61 views

When trying to pass a string directly to a function results in Segmentation error [duplicate]

When trying to pass a string directly to a function results in Segmentation error whereas copying in an array and running it works fine. I am having hard time understanding this cause of segmentation ...
Kung Pao's user avatar