C/C++

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • Segmentation Fault in my program

    3 answers - 1112 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    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 "WINDW *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
  • No.1 | | 1102 bytes | |

    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 & JAT-in-training | GPG public key available on request
    Registered Linux User #112576 (http://counter.li.org/)
    Slackware - Because I know what I'm doing.
    PGP SIGNATURE
    Version: GnuPG v1.2.7 (GNU/Linux)

    miXXAkS+MfwrsdyU1Ha8jY=
    =0uNw
    PGP SIGNATURE
  • No.2 | | 1367 bytes | |

    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).

    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 & JAT-in-training | GPG public key available on request
    Registered Linux User #112576 (http://counter.li.org/)
    Slackware - Because I know what I'm doing.
    PGP SIGNATURE
    Version: GnuPG v1.2.7 (GNU/Linux)

    fyaXfVK/p6b09MAnvnXZ2HQ=
    =SJUi
    PGP SIGNATURE
  • No.3 | | 418 bytes | |

    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.

Re: Segmentation Fault in my program


max 4000 letters.
Your nickname that display:
In order to stop the spam: 5 + 4 =
QUESTION ON "C/C++"

EMSDN.COM