Segm fault

This is a discussion on Segm fault within the C Programming forums, part of the General Programming Boards category; Hello. For this code: C code - 503 lines - codepad I get these errors: projekt3.c: In function `znajdz_baze_w': projekt3.c:209: ...

  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 02: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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,496
    > 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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21