76 Topics
|
|
Hi I have question about controlling segments with the ASSUME directive I know its not necessary to use assume for code segment( every program have cs , ??) but why and when we use " assume cs:xxxx" ? What does it say to cpu(8086)? can anybody explain me use of … |
|
I am declaring a structure as this [CODE]typedef struct Request { deque<int> roomsList ; }Request;[/CODE] Then , in some other function I get a segmentation fault in the highlighted line : [CODE] int initRoomsList(Request *R) { int roomSatisfying ; char roomName[20] ; int roomNum, capacity,wb,proj, lcd, sound, aud, vid , … |
|
This is another homework problem. I thought it was easier, and I wouldn't need help, but I keep getting a segmentation fault when running the program. The assignment is to use a recursive function to output the amount of candybars we can buy with a user-inputted amount of money. Each … |
|
I wrote this program and it compiled with no errors or warnings but when i went to run it i get a segmentation fault and i cant figure out what is causing it. Ive spent hours and hours on this . Anyone with some expertise willing to take a look? … |
|
Hi.... I wrote a program for Quick Sort algorithm.... It is compiled fine....but it is giving a run time error i.e., Segmentation Fault.... I tried hard but couldn't find out what is that thing causing segmentation error in this program.... Please help.... I'm getting segmentation fault very frequently (i'm using … |
|
Hi, I'm getting segmentation fault errors when I use quicksort with ~350 000+ numbers. This is the quick sort algorithm I'm using: [CODE]void swap(int* v, int i, int j) { int tmp = v[i]; v[i] = v[j]; v[j] = tmp; } int partition(int *v, int s, int e) { int … |
|
I wrote this program for insertion sort.I compiled the source file in xubuntu terminal.But when I try to run a.out executable....terminal showing "segmentation fault".I don't about segmentation fault..when segmentation fault occurs...what is the thing in the source file that is causing segmentation fault... Thanks in advance...... [CODE]#include<stdio.h> main(){ int i,j,n,key; … |
|
I am currently creating a queue ADT for one of my classes in college. We are using a linux ssh server for compiling our programs, but i am writing the code in windows. When i compile i get no errors, but when i run it goes fine until it hits … |
|
Hi! It's me again :) I have failed with my C++ code once again. This time it's with vectors. [CODE]string show_actions(){ vector<string> actions; actions.push_back("end"); actions.push_back("hunt"); vector<string>::const_iterator iter; cout <<"All of the possible actions are : " << endl; for(iter = actions.begin(); iter != actions.end(); ++iter){ cout << *iter << endl; … |
|
Please help me find the error with my code. Whenever I try to run the program, it returns a Segmentation Fault message. I've been trying to find and play with the codes but I'm really stuck.. Please help me.. Here's my code: [CODE] .section .data format: .asciz "%d\n" values: .int … |
|
Hello all, I was trying this problem of checking if the input integers can be ordered using the STL implementation of the stack. The program reads from a file named "input.txt" which in its first line has the number of integers that follow in the second line. The second line … |
|
|
A recent assignment involved using very large integer values. A formula and very large x values were given and we had to compute the value of f(x). The tutor suggested using long long values as the 0 < x < 10^18. The function F(x) = F(x/2) - x if x … |
Hello! I am making a program which does many computations for a Photovoltaic system. The problem is that i get a strange segmentation fault error when I run the program. Here is where it crushes (at for-loop of calculation S5) : [CODE] commands..... ... ... /******************** WIRING *******************************/ Ni = … |
|
This program separates palindromes from non-palindromes in a text file. After separating them into separate two dimensional arrays, I have to sort them in ascending order by string length. The last part is to output both the palindromes and non-palindromes in centered, triangle format. I've gone through this program multiple … |
|
hello all i have been writing the java code and new to C programing.I am very confused in point.i have the following code [CODE]#include<stdio.h> main() { int *ptr=50; printf("%d",*ptr); return 0; } ~ ~ [/CODE] why it is giving the segmentation fault.and when i print ptr then it gives value … |
|
Hi all, I am currently working with some c++ code on an ARM processor. The issue i am having is that when my application hits a segfault i am unable to get any information as to what caused it. My dev machine is ubuntu 10.04 LTS and i am using … |
|
Hi, help please! I have a struct containing an array of pointers to structs containing Binary Search Trees with nodes containing structs. ... <*sigh*> I hate C soo much... put work wants it to be in C. I can set the struct of BST's just fine, and keep it around, … |
|
[CODE]/* this code attempts to generate a sudoku board in an non graphical envoirnment the code compiles fine but however it throws segmentation fault everytime it's run*/ # include<stdio.h> # include<stdlib.h> # include<time.h> static int baseArray[9][9]; static void initialise(); void display(); static int checkPosition(int row, int col, int value); int … |
|
Hi folks, I am learning C++ programming. Below mentioned program giving segmentation fault ONLY WHEN if I declare 'struct s a;' ABOVE 'struct s *b;'. Can anybody tell me the reason? [CODE] #include<iostream> using namespace std; struct s { int m; }; int main() { struct s a; // if … |
|
Hi, I am writing a program to solve the 8puzzle, but for some reason i am having more difficulty with the structure than the algorithm.... I have two classes, a tree and node class. My main problem is to put the nodes in an array in the tree class. Second, … |
|
I'm getting a segmentation fault at this line. So far, my program has classes. A blahpod with class of songs in them. Then there is the node class. I call the operator= which is supposed to put one pod into another. It looks like so [CODE]bobcatPod bp2( bp1 );[/CODE] That … |
|
Hi, I need to create a program to do a threaded merge sort (kinda), but in the meantime I am trying to pass a struct through the the Merge method (thread runs this method), but I keep getting seg faults. I am sure its something obvious, please help me out. … |
|
This is giving me a segmentation fault in the noBucket() function. I don't see why. Does it having something to do with it being a const function? My other accessor functions are working fine and they are declared exactly the same with just a different name. The files are longer … |
|
The title explains most of it. at the point in the code where this frame gets created it immediately opens, closes, then segfaults, and the whole program dies. the program worked find before this frame was added and the only code using this frame from outside of it is the … |
|
|
Binary search tree for strings. I tried my best to trace out the error but in vain Need help. [CODE] #include<stdio.h> #include<stdlib.h> #include<string.h> struct bstree { char keyword[25]; struct bstree *lnode,*rnode; }*root; void insert(struct bstree *new,struct bstree *old) { if((strcmp(new->keyword,old->keyword))<0 && old->lnode==NULL) { old->lnode=new; } else if((strcmp(new->keyword,old->keyword))<0 && old->lnode!=NULL) { … |
Hi all, I write because I am struggling with a very strange thing. I have this class: [CODE] static const long POINTS_VERY_FEW = 100; class Bin2DSphere { /*! Class for 2-dimensional binning on a sphere */ public: string Name; double PhiMin; /* Minimum value of Phi */ double PhiMax; /* … |
|
[CODE] #include<stdio.h> #include<stdlib.h> int **array(); main() { int **result=array(),i,j; //display result for(i=0;i<2;i++) printf("\n"); for(j=0;j<2;j++) printf("%d \t",result[i][j]); } //function int **array() { int nrows=2,ncolumns=2,i,j; // printf("hi"); //memory allocation int **array; array = malloc(nrows * sizeof(int *)); if(array == NULL) { printf("out of memory\n"); return 0; } //printf("hi"); for(i = 0; i … |
|
Hello, Any ideas why this is giving a segmentation fault?: #include <iostream> #include <new> using namespace std; struct List { int A; int B; List *next; }; int main(void) { int llength; llength=1111111111; List *L; L= new List[llength]; L[37370197].B=-37370197; delete [] L; return 0; } Cheers |
|
Hello, I'm doing a full traversal of a binary search tree structure looking for a node by a field that is not the sort key. If the node i'm looking for is the root node, no problem. If it's any other node then the function has a Seg Fault. Anyone … |
|
I have been struggling with this for a while. Will someone please help me? The issue is within a while loop. The while loop is reading info from getline, copying values from an input file to (1)double array type char[i][20] , (2)array type double [i]. The input file is as … |
The End.