473,399 Members | 3,106 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Segmentation Fault in my program

Hi Friends,
I am working on a project of User Interface Class Library. In
it, I have to create a class library in "gnu" using c++ and curses
library. I am facing problem while I am on the way of organizing the
file.
Actually I had to create the header files. Now, when I
initialized the "WINDOW *win" in the Super class Window and destroy it
there using "endwin()" command, I am facing segmentation fault.
Beside this I had organized the common attributes of various
User Interfae controls into structure, take for example:
struct Position{
int Height;
int width;
}

Position *p={23,34};

// the struct is declared as global. and its default value declaration
is also global.

In the Label class, when I try to pass this value to the local variable
that too give me a segmentation fault,...

//code extract

class label
{
private:
Position *LoP;
public:
int default()
{
LoP=&P;
}
}

Can anyone please help me in getting out of this problem.
with regards

Amar Prakash Tripathi

Dec 3 '05 #1
3 1541
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Amar Prakash Tripaithi wrote:
Hi Friends,
I am working on a project of User Interface Class Library. In
it, I have to create a class library in "gnu" using c++ and curses
library. [snip] class label
{ [snip C++ code] }

Can anyone please help me in getting out of this problem.


Sure. You just have to ask the right people.

Unfortunately, comp.lang.c is not the right place to find the right people to
answer a C++ question involving a Microsoft WinXX API.

You want to ask the kind folk in comp.lang.c++ (just down the hall, second
door on the right) or the people of the microsoft.* or comp.ms-windows.*
groups (up two flights, floors 10 and 11).

HTH
- --
Lew Pitcher

Master Codewright & JOAT-in-training | GPG public key available on request
Registered Linux User #112576 (http://counter.li.org/)
Slackware - Because I know what I'm doing.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.7 (GNU/Linux)

iD8DBQFDkbQZagVFX4UWr64RAi6kAJ9JDXz21Qys+gg0V45m+h c+VCXMPACgoyyN
miXXAkS+OMfwrsdyU1Ha8jY=
=0uNw
-----END PGP SIGNATURE-----
Dec 3 '05 #2
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Lew Pitcher wrote:
Amar Prakash Tripaithi wrote:
Hi Friends,
I am working on a project of User Interface Class Library. In
it, I have to create a class library in "gnu" using c++ and curses
library.
[snip]
class label
{
[snip C++ code]
}

Can anyone please help me in getting out of this problem.

Sure. You just have to ask the right people.

Unfortunately, comp.lang.c is not the right place to find the right people to
answer a C++ question involving a Microsoft WinXX API.

You want to ask the kind folk in comp.lang.c++ (just down the hall, second
door on the right) or the people of the microsoft.* or comp.ms-windows.*
groups (up two flights, floors 10 and 11).


Oops. Correction

You're using curses, not Microsoft WinXX

So, instead of microsoft.* and comp.ms-windows.* you probably want
comp.os.unix.* and/or gnu.* . Both are downstairs, on the 2nd and 3rd floor.

- --
Lew Pitcher

Master Codewright & JOAT-in-training | GPG public key available on request
Registered Linux User #112576 (http://counter.li.org/)
Slackware - Because I know what I'm doing.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.7 (GNU/Linux)

iD8DBQFDkbSqagVFX4UWr64RAkbrAJ918kz54N3EUqs2suCubt Qsr8ZCkACgsxt6
fyaXfVK/p6b09MAnvnXZ2HQ=
=SJUi
-----END PGP SIGNATURE-----
Dec 3 '05 #3
Lew Pitcher said:
You want to ask the kind folk in comp.lang.c++ (just down the hall, second
door on the right) or the people of the microsoft.* or comp.ms-windows.*
groups (up two flights, floors 10 and 11).


Apart from your other correction to the above, I should perhaps add that the
kind folk in clc++ won't take any more kindly to the discussion of
extensions than we do here in clc.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
Dec 3 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: sivignon | last post by:
Hi, I'm writing a php script which deals with 3 ORACLE databases. This script is launch by a script shell on an linux machine like this : /../php/bin/php ./MySript.php (PHP 4.3.3) My script...
10
by: Vishal Grover | last post by:
Hello Everyone, I am seeing a certain behaviour which I find strange, and am curious to get an explanation to it. I have the following program. #include <iostream> #include <cstdlib> using...
3
by: diyanat | last post by:
i am writing a cgi script in C using the CGIC library, the script fails to run, i am using apache on linux error report from apache : internal server error Premature end of script headers:...
16
by: laberth | last post by:
I've got a segmentation fault on a calloc and I don'tunderstand why? Here is what I use : typedef struct noeud { int val; struct noeud *fgauche; struct noeud *fdroit; } *arbre; //for those...
6
by: damian birchler | last post by:
If I run the following I get a segmentation fault: #define NAMELEN 15 #define NPERS 10 typedef struct pers { char name; int money; } pers_t;
3
by: Zheng Da | last post by:
Program received signal SIGSEGV, Segmentation fault. 0x40093343 in _int_malloc () from /lib/tls/libc.so.6 (gdb) bt #0 0x40093343 in _int_malloc () from /lib/tls/libc.so.6 #1 0x40094c54 in malloc...
5
by: Fra-it | last post by:
Hi everybody, I'm trying to make the following code running properly, but I can't get rid of the "SEGMENTATION FAULT" error message when executing. Reading some messages posted earlier, I...
7
by: pycraze | last post by:
I would like to ask a question. How do one handle the exception due to Segmentation fault due to Python ? Our bit operations and arithmetic manipulations are written in C and to some of our...
6
by: DanielJohnson | last post by:
int main() { printf("\n Hello World"); main; return 0; } This program terminate just after one loop while the second program goes on infinitely untill segmentation fault (core dumped) on...
8
by: Andrea | last post by:
I wrote this code: void * xmalloc (size_t size){ register void *value = OPENSSL_malloc(size); if (value == 0) printf("virtual memory exhausted"); return value; } int _chooseTSK(char*...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.