76 Topics
|
|
|
I'm using Dev-c++ to make a dialog-based app. I had it working, but now I am getting an error: An Access Violation (Segmentation Fault) raised in your program. I have narrowed it down to the winmain function: [CODE]int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLine, int iCmdShow) { if (iCmdShow … |
Ok basically I have a program that is doing a counter clockwise spiral and will print the value i or print out a 0 depending upon if the number is prime. n is equal the length of the spiral while i is the initial center value of the spiral which … |
|
Yeah this is a simple question and pretty popular. And this is what I did. There is a segmentation fault when we copy characters from [ICODE]src [/ICODE]into [ICODE]dest[/ICODE]. Now, I can understand the source of this fault - when we iterate over the [ICODE]dest [/ICODE]string we reach the end and … |
|
My first post on this forum, long time lurker though. I'm running into a problem trying to search through an N-ary tree. I'm tasked with having the user input pairs of job titles and from there putting them into an N-ary tree, with the higher job titles at higher levels. … |
|
can anyone please tell me what is wrong with dis code.....i am getting a segmentation fault even though it has been compiled successfully(in a unix system): [CODE]#include<stdio.h> int low,high,mid; void msort(int a[],int low,int high); void merge(int a[],int low,int high,int mid); int main() { int a[10]; int count; for(count=0;count<10;count++) { printf("Enter … |
|
I seem to be getting a segmentation fault in my array. When I run it the the TF and TC appear at the top then the array. That's when the error occurs. I tried debugging it and when tf = 10 the error was occuring. Can someone help plz. #include … |
|
Hey there, I'm currently using NetBeans 6.8 running Cygwin GNU Bash version 3.2.49(23)-release. I'm having a problem running my program that uses pthreads, mutexes, and semaphores. After it creates 1 to 3-4 threads, it returns a Segmentation fault. I ran the program on a computer running Linux (using NetBeans as … |
|
I am learning to write C++ code to access data in a MySQL database. My goal is to use a separate class to control the database access so I can use this class elsewhere. To facilitate my learning, I'm working on simple code to connect to a database (success!) and … |
|
Hi all, i've to make an introduction of what am i doing before start making questions. The goal of my work is to create an application quite like an IDE, for specific program development ( always in C++ ) and testing. Since the need of execute these programs under the … |
|
I have a program that works fine under windows, but when i run it on Unix I get a very slightly diffent set of results, followed by a 'segmentation fault' message. I'm at a loss to explain why. Any ideas? |
|
I'm working on a C program that needs a lot of dynamic memory allocation of 1-D and 2-D arrays. The program works fine when I compile and run it using windows and Visual C++, but when I compile and run it in a Unix environment, I get slightly different results, … |
|
Hi everyone, I'm a moderately experienced C++ programmer working on code which must do the following: (a) Import data from a lot of little CSV files (b) Load that data into various objects (c) Do stuff with that data The code I've written does (a), (b), and (c) pretty well, … |
|
hey guys/gals. i get a segmentation fault whenever the for loop in the print function is executed. any suggestions? im not sure what i did wrong. [CODE]//class member functions #include "experiment.h" #include <iostream> #include <fstream> #include <cstdlib> #include <iomanip> using namespace std; int Experiment::numberOfTests = 0; Experiment::Experiment(){} void Experiment::setExpName() { … |
|
Bellow is the piece of code that causes Segmentation Fault: (in Linux Segmentation Fault is usually due to illegal memory access) else if(intData==3) { FILE *fp; int ch; if((fp = fopen("file.txt","rb"))==NULL) { printf("Cannot open Source file.\n"); exit(1); } while((ch = (int)fgetc( fp )) != EOF) { printf("%s",(char*)ch); send(client, (char*)ch, 1,0); … |
|
Bellow is the piece of code that causes Segmentation Fault: (in Linux Segmentation Fault is usually due to illegal memory access) else if(intData==3) { FILE *fp; int ch; if((fp = fopen("file.txt","rb"))==NULL) { printf("Cannot open Source file.\n"); exit(1); } while((ch = (int)fgetc( fp )) != EOF) { printf("%s",(char*)ch); send(client, (char*)ch, 1,0); … |
|
I wrote this small program for a class im taking, and its supposed to take an int n and a radix (int between 2 and 16) r and give me the number converted to the new base. It only has to go from decimal to other radix's. I run my … |
The End.