Most voted "segmentation-failure" questions
24 questions
Sort by count of
-
2
votes1
answer101
viewsSegmentation Fault function that changes the values of 2 strings
The following function changes (or at least should) the content of two strings void trocar(char *a, char *b){ char *novo = (char *) malloc(sizeof(char) * 10); strcpy(novo, a); strcpy(a, b);…
-
2
votes1
answer59
viewsSegmentation Fault na strcat()
Recently I started learning about function strcat() and developed the code below, but I’m encountering a Segmentation fault: #include <stdio.h> #include <stdlib.h> #include…
-
2
votes1
answer36
viewsI tried debugging for a long time, but I can’t correctly omit consecutive repeat characters
I’m trying to create code to omit repeated characters in a row. I don’t know what’s going on and I’ve tried debugging for hours. Anyway, I’m trying to locate occurrences of consecutive repeated…
-
2
votes1
answer64
viewsProblems with the realloc() function in C language
Hello guys! I am implementing a code to insert a kind of table into a pointer and relocate memory while the function add() is being executed, the function name() will be executed only once to set…
-
1
votes2
answers82
viewsWhy does this code give Segmentation fault?
Whenever the first line of the map is filled in, a Segmentation fault, I wonder why. void newmap(int x, int y , int players){ int linha,coluna; char **map = (char **) malloc(sizeof(char*) * y); *map…
-
1
votes1
answer62
viewsWhy is my C code that uses queue giving Segmentation fault?
Hello I must implement a queue that receives the name information and Cpf but only when I try to unroll something gives seg fault, without the row of the unroll wheel normal, but I do not see the…
-
1
votes0
answers63
viewsC++ How to take the string of the get method of a class x and concatenate with a class y string?
I am programming a code in Qt(C++) and I need to take values from the client class in the menu class (which I do not inherit from client) and concatenate into a string to print on the screen.…
-
1
votes0
answers20
viewsDoubt regarding C pointers
I am writing a program that has 3 files: algorithms. h, algorithms. c and main. c. This program has several integer vector ordering algorithms. With the intention of making the program more…
-
1
votes0
answers40
views(training/beginner) Problem with segfault in fread() and fwrite() in . txt!
Whoops, you guys! First I wanted to say that I am very beginner and self-taught. I started with CS50 and I’m on the walk, rs. Contextualizing the code: 1x a week I work at an organic fair and I need…
-
0
votes2
answers5464
viewsSegmentation failure: Recorded core image
I made a code in C to find the smallest value and position of it in a vector x[N]. Every time I compile the program by terminal (Linux), it accuses the following message: Segmentation failure…
-
0
votes1
answer90
viewsProblem with Segmentation fault with whole pointer
The program below attempts to reproduce a cellular automaton model. When I use "n" (number of cells) above 65 thousand, the program returns Segmentation fault. I tried to "print" some text in…
-
0
votes0
answers173
viewsError Segmentation fault(core dumped) in C
When trying to calculate which prime can make a division of rest 0 with the number 600851475143 I came across the error segementation fault(core dumped) (although I used the sieve of Eratosthenes…
-
0
votes1
answer43
viewsHow to dynamically allocate memory to a 2D array that stores the pixels of a bmp file in C?
I am trying to dynamically allocate a 2D array to store a bmp file with the following code: #include <stdio.h> #include <stdlib.h> int height, width; // variables for the image height…
-
0
votes0
answers26
viewsIncreasing the capacity of an int - C
When trying to calculate which prime can do a 0 rest split with the number 600851475143, I get the error Segmentation fault with the following script: int count_1 = 0, count_2 = 0, soma = 0, maior =…
-
0
votes0
answers54
viewsHow to solve segmentation failure (recorded core image) in recursion?
I’m having trouble with this part of my show. I have to do a function with the Bron-Kerbosch algorithm, but it is giving the following error: segmentation failure (image of the recorded core) and I…
-
0
votes1
answer117
viewsNASM SEGMENTATION FAILURE
Code update: I followed the tips and tried to stop the loop in the update section. I’m still working on the segmentation failure, however. And I need to check this loop, I don’t think it’s quite…
-
0
votes0
answers36
viewsI’m having trouble segmenting an image
I’m creating a mix of image segmentation by k-Means and Spectral clustering, but I have a big problem at the end. I’ll leave the code here: import cv2 import timeit import time import numpy as np…
-
0
votes0
answers36
viewsHow to resolve Signal: Segmentation fault (core dumped) in C++
I’m trying to make a noose and on that part, always gives the core error dumped. how can I solve this problem? cout << newnome1 << ", ESCOLHA UMA PALAVRA: "; cin >> palavraSecreta;…
-
-1
votes1
answer197
viewsProgram Received Signal SIGSEGV, Segmentation fault
When I call this function happens this error "Program Received Signal SIGSEGV, Segmentation fault." void cria_agenda(Agenda *agenda_prof, int Id_prof, char *nome, int ano){…
-
-1
votes1
answer125
viewsSegmentation Error
Hello. Could anyone help me with this error (Segmentation fault)? I don’t know why it’s happening. #include <stdio.h> #include <stdlib.h> #include <string.h> typedef struct cel {…
-
-1
votes2
answers63
viewsSegmentation failure when printing white space C
I need to do a function that returns a doorman to the first blank space found in the string. When I try to print the blank space the program accuses segmentation failure, which does not happen when…
-
-1
votes0
answers28
viewsSegmentation fault (conversion to post-fixed notation)
The idea of the code is to convert a numerical expression to post-fixed notation (reverse polish), but I cannot run because it gives the error: Segmentation fault (core dumped) Example: Entry:…
-
-2
votes1
answer36
viewsSegmentation Fault when running pop command on dynamic stack
I’m trying to implement a dynamic stack but the program ends in error when executing the pop(pop) pop function, returning a Segmentation Fault. I can’t understand why.. I appreciate the help.…
-
-3
votes1
answer27
views"Segmentation fault(core dumped)" error in C language if-Else program
Greetings! I’m a beginner in programming and found this problem in a code: Segmentation fault (core dumped), after entering the first variable. That is the code: #include <stdio.h> #include…