Results 1 to 5 of 5

Thread: c help.

  1. #1

    c help.

    i am using printf (tmp) where tmp is an int. But evertime gdb pass to the line where is located the line it gave me this error
    "Program received signal SIGSEGV, segmentation fault" then go to the assembler code while it is not supposed to. How can i fix it?

  2. #2
    http://www.cplusplus.com/reference/c...io/printf.html

    printf("%d", tmp);

    By the way unless you are developing something specific for C, you should be using C++. There's no reason not to.

  3. #3
    Quote Originally Posted by Sirisian View Post
    By the way unless you are developing something specific for C, you should be using C++. There's no reason not to.
    I disagree with that. They're both good languages, but I feel you should not be using C++ unless you need to be. C is more compact and more memory efficient. If you're looking to get down and dirty anyways, don't go back and add abstraction unless it's necessary.


    K-Emmys-06: Best Footer; and K-Emmys-06: Most Active Member

  4. #4
    I'm kind of surprised that compiled. I guess printf is one of those semi-macro functions...
    If you notice this notice you will notice that this notice is not worth noticing.

    "Are you doing anything tonight? If not, how about me?"

    Opera Sucks! - FIX IT
    Oliver Zheng

  5. #5
    C might be more efficient, and more memory efficient, but like he said, unless you need it to be compact and efficient, there is no reason to not use C++.

    when performance you get out of C does not pay for the lack of readability. Even more so as CPU's are really fast.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012