Segmentation Fault in my program

  • Thread starter Amar Prakash Tripaithi
  • Start date
A

Amar Prakash Tripaithi

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
 
L

Lew Pitcher

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
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+hc+VCXMPACgoyyN
miXXAkS+OMfwrsdyU1Ha8jY=
=0uNw
-----END PGP SIGNATURE-----
 
L

Lew Pitcher

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Lew said:
Amar said:
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]


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)

iD8DBQFDkbSqagVFX4UWr64RAkbrAJ918kz54N3EUqs2suCubtQsr8ZCkACgsxt6
fyaXfVK/p6b09MAnvnXZ2HQ=
=SJUi
-----END PGP SIGNATURE-----
 
R

Richard Heathfield

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
474,175
Messages
2,570,942
Members
47,476
Latest member
blackwatermelon

Latest Threads

Top