76 Topics

Member Avatar for
Member Avatar for Chef Boyardee

Hello, this is my first post here. I'm playing around with Gtk+ and Xlib. I'm trying to get the X window ID of the active window, and then display that ID in a Gtk label. However, when I run it, it seg faults. I've narrowed it down to `XGetInputFocus`, but …

Member Avatar for Chef Boyardee
0
630
Member Avatar for can-mohan

guys, I am implementing hash function in below code snippet but unfortunetly getting segmentation fault. Could you please help me to understand that what went wrong in this implementation. #include<stdio.h> #include<string.h> #include<stdlib.h> unsigned long hash(char** str ) { unsigned long hash_val = 5381; unsigned long sum=0; char* val ; int …

Member Avatar for can-mohan
0
384
Member Avatar for srao1

Here is the mex code I wrote to read in a tab-delimited file. The mex file got created but it causes my MATLAB to end abruptly and give the following error. Can anyone help me where I am going wrong? Please let me know if any further information is required …

Member Avatar for Ancient Dragon
0
371
Member Avatar for greatman05

Hello. I need to set up some pipes for a homework assignment as part of a bigger project. The issue I'm having is that the array (args) I'm using to populate the pipe arguments keeps segfaulting and I don't know why. Everything has been malloced beforehand and the faults only …

Member Avatar for greatman05
0
256
Member Avatar for Labdabeta

This is more of a tale of "I think I broke it". Basically as an assignment for CS I have to write an assembler for a subset of the MIPS assembly language. Currently it is not working, getting a sigseg, so I decided to debug the code and step through …

Member Avatar for rubberman
0
305
Member Avatar for J-P1988

Hey I have an code in Qt that is an QPushButton is hidden at start of the cpp but later i want to get it appear when the file is open and an line is readed but the problem i get an segmentation fault. Can be because the setHidden(true) in …

0
132
Member Avatar for pigrabbit87

I's running this on visual c++ and it runs without error. However, when I tried to run this on Linux, it kept giving me this "segmentation fault" message without any output. There is no pointer and is a quite simple program so can anyone please tell me what is wrong?? …

Member Avatar for pigrabbit87
0
3K
Member Avatar for testie

Im having some trouble putting together a linked list implementation of a queue. I'm getting a segmentation fault, which I believe is due to my empty() function because in an attempt to fix my empty() function, I made it determine empty based on (current_size == 0) instead of (front_p == …

Member Avatar for dx9_programmer
0
752
Member Avatar for pattilupwned

Hello, I am writing a program that reads in data from a text file and puts it into a linked list. Certain variables are read in only if the "officeHeld" number is a particular number, otherwise the variable is set to 0. When I run this through Visual Studio, I …

Member Avatar for dx9_programmer
0
350
Member Avatar for HelloJarvis

Hey guys, I'm loading from a dictionary with a variable called "buffer". I'm trying to copy "buffer" in to another array word for word. For some reason, when I try using `strncpy()`, it yields a segfault. Here is my code (assuming "LETTERS" is 29: bool load(string filename) { // open …

Member Avatar for dx9_programmer
0
243
Member Avatar for HelloJarvis

Hey guys, I'm working with `strchr` and, for some reason, am getting a segfault. My program takes a string, iterates through the characters of that string, and adds a score to the "game" based on what letter the current character is. That sounds complicated, but my code will explain it: …

Member Avatar for HelloJarvis
0
1K
Member Avatar for nagarjuna844

Hi, I'm new to C++. plzz help me with this error. #include <cstdlib> #include <iostream> #define clauselength 85 //we will use index number to find out the clause number. //there are 88 clauses. as we start using index from 1 we have to add one to 89. using namespace std; …

Member Avatar for np complete
0
243
Member Avatar for Subodh11

plz help me to solve the error in this program : Given programs replaces multiple spaces with only one space... there is no error , but it shows "Segmentation Fault"...whats the issue ????????? #include<stdio.h> int main(void) { char *t="ALOK KUMAR ASHISH KUMAR ANKUSH"; char *c; int n1=0; while (*t) { …

Member Avatar for Ancient Dragon
0
140
Member Avatar for jayram.chandan

#include <stdio.h> #include <stdlib.h> long i,j,k,*ni,qi,a,*arr,n,q,p,no,c=0,m,max=0; int main() { ni = malloc(sizeof(long) * 100000); arr=malloc(sizeof(long)*10000); scanf("%ld",&no); for(i=1;i<=no;i++) { scanf("%ld %ld",&n,&qi); for(j=1;j<=n;j++) { scanf("%ld",&ni[j]); } for(k=1;k<=qi;k++) { scanf("%ld %ld %ld",&a,&p,&q); while(p<=q) { arr[++c]=ni[p++]^a; } for(m=1;m<=c;m++) { if(arr[m]>max) { max=arr[m]; } } printf("\n%ld",max); max=0; c=0; } } return 0; } Bold Text …

Member Avatar for jayram.chandan
-1
234
Member Avatar for vikingsheepman

Hello all! I have used this forum many times in the past to solve a variety of programming related problems, but am truly stumped on a segfault within a binary search tree. I have isolated the segfault to a fscanf statement that look legitamate to me. The following code blocks …

Member Avatar for vikingsheepman
0
262
Member Avatar for dancks

I don't really have an explanation and whoever thought that this new posting format was the way to go... idk what to say. I really don't like it. I can only post so much lines of code before something happens to the window and I can't scroll all the way …

Member Avatar for mike_2000_17
0
258
Member Avatar for hypernova

Hi all !! I am new to Fortran. Please see the following code: program exp_realloc implicit none integer,allocatable,dimension(:,:):: array integer::i,j allocate(array(3,3)) write(*,*)size(array,1)," ",size(array,2) do i=1,3 do j=1,3 array(i,j)=i*j write(*,*)array(i,j) enddo write(*,*) enddo CALL func(array) end program exp_realloc subroutine func(array) integer,dimension(:,:),intent(in)::array integer::i,j write(*,*)"********* Inside subroutine **********" write(*,*)size(array,1)," ",size(array,2) write(*,*)array(1,1) write(*,*)array(1,2) write(*,*)array(2,1) …

0
132
Member Avatar for mcjiwe

main.c #include <stdio.h> #include <stdlib.h> #define MAX_USERS 100 typedef struct Utilizadores{ char *login; char *pwd; } USERS; void ReadUsers(USERS user[]); int u = 0; int main(){ USERS user[MAX_USERS]; ReadUsers(user); return 0; } void ReadUsers(USERS user[]){ FILE *fp; fp = fopen("/home/Jiwe/Desktop/users.txt", "r"); while(fscanf(fp, "%s[^=]=%s\n", user[u].login, user[u].pwd) != EOF){ u++; } fclose(fp); …

Member Avatar for mcjiwe
0
8K
Member Avatar for Lucaci Andrew

I was wandering what could be the causes of this error message? Like in general. `\\: *stopped,reason="signal-received",signal-name="SIGSEGV",signal-meaning="Segmentation fault",frame={addr="0x00402d53",func="Domain::Movie::show",args=[{name="this",value="0x1"}],file="..\\src\\Domain\\Movie.cpp",fullname="e:\\eclipse for c++\\workspace\\lb6-8oop\\src\\domain\\Movie.cpp",line="36"},thread-id="1",stopped-threads="all"` 10x.

Member Avatar for gusano79
0
700
Member Avatar for saamsonn

#include<stdio.h> int strlen_(const char *string); int strlen_(const char *string) { int length; for(length = 0; *string != '\0'; string++){ length++; } return length; } char *strcat_(char *string1, const char *string2); char *strcat_(char *string1, const char *string2) { char *p = string1; if(string1 == NULL || string2 == NULL) return string1; …

Member Avatar for Ancient Dragon
0
183
Member Avatar for efficacious

hi all, total noob here with assembly. I'm working on a project for one my classes and for some reason we all keep getting segmentation faults when attempting to run the program. I can't for the life of me figure out what the heck is going on and why this …

Member Avatar for efficacious
0
346
Member Avatar for jeevsmyd

[code]for(int i=0;i<=c;i++) { l=0; if(strcmp(findedge(tst[i],dfa[0][j]),"null")!=0) { strcpy(t1,findedge(tst[i],dfa[0][j])); //l=strlen(temp); strcat(temp,","); strcat(temp,t1); //temp[l+1]='\0'; //temp[l]=','; } } [/code] When I try to append comma or some other symbol to temp, a segmentation fault occurs. If that step is omitted everything works perfectly. This is code is from my program to convert NFA to …

Member Avatar for Ancient Dragon
0
239
Member Avatar for benclifford

Hi, I have a task to perform which all to do with the smurfs, reading from a file and doing some simple stuff to it. The last part I need to do is print out a list of all smurfs and their corresponding role in alphabetical order. I am hoping …

0
225
Member Avatar for Adnan671

Here are program instructions. IT SAYS "segmentation fault" WHEN RAN. Specifications You must create a Ship class: The Ship class maintains the position data for each ship/vessel and its distance from another Ship. It has a default constructor, which sets all of the member data to zero, and a non-default …

Member Avatar for WaltP
0
162
Member Avatar for reynaud0000

Hi this my first post here XD Its like this i have the code writen but it gives me this error Segmentation fault (core dumped) Can anyone tell me why? [code] MAX_BUFFER equ 10240 ; Constante que sera' usada como tamanho maximo de cada linha lida do teclado (10kb) FICH_ABERTURA …

Member Avatar for Ancient Dragon
0
285
Member Avatar for stamatt45

I'm writing a program to convert Decimal numbers to binary, hexadecimal, and BCD as a refresher before i start getting code assignments in school. I'm almost done, but i have a seg_fault (compiler says decToHex function) in 1 function and i am hoping for some feedback on the others. I'll …

Member Avatar for raptr_dflo
0
3K
Member Avatar for stamatt45

[I]To make it easier to read, only the relevant code is below, and due to circumstances beyond my control im stuck using Xcode for the next week or so (hate this debugger).[/I] I need help fixing a seg_fault in my current program. It occurs the last time "buildPaths" is called. …

Member Avatar for stamatt45
0
221
Member Avatar for jcAmats

I’m creating a program that displays random lines from a file. I have 8 lines on my text file and after displaying the last/8th random line… it displays [B][I]Segmentation fault[/I][/B] and then terminates the program. The program should display a message saying that there are no lines left to display. …

Member Avatar for jcAmats
0
11K
Member Avatar for zhanrah

Please help me fix my code.. It works in CodeBlocks but when I try in Linux, it says it has an error - SEGMENTATION FAULT (core dumped) :( This program converts between bases of a number. After it converts a number it should go back to start to get input …

Member Avatar for Moschops
0
203
Member Avatar for tvm78

so i have this program written and i am getting a seg fault and the stack said in operator<<. I have no idea how to fix this...It is due in thirty minutes if someone can please help me asap. Here is where i think the problem lies: [CODE]#include <iostream> #include …

Member Avatar for Ancient Dragon
0
213

The End.