Thread: Segm fault

  1. #1
    Registered User
    Join Date
    Oct 2009
    Posts
    32

    Segm fault

    Hello.

    For this code: C code - 503 lines - codepad I get these errors:

    projekt3.c: In function `znajdz_baze_w':
    projekt3.c:209: error: `bieza' undeclared (first use in this function)
    projekt3.c:209: error: (Each undeclared identifier is reported only once
    projekt3.c:209: error: for each function it appears in.)
    projekt3.c:209: error: parse error at end of input


    What's wrong?
    Last edited by jacek; 01-17-2010 at 03:49 PM.

  2. #2
    Registered User
    Join Date
    Oct 2009
    Posts
    32
    OK guys. I have taken care of these erros and none of them are present. It was my connection fault, I think.


    I get this segm fault when I want to use dodajBaze. How to fix it?

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    > How to fix it?
    By initialising the pointer you pass to it.

    If you use a debugger, put a breakpoint at the start of dodajBaze(), then single-step your way into dodajBaze, you'll see the pointer is garbage, and then you dereference it.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed