Everybody! This is important. In a few days, these forums will be moving over to using the totally sweet Discourse platform. To ensure this migration happens smoothly with no loss of content, these forums are currently in a read-only mode. I do apologize for the inconvenience.

There is never a good time to turn the forums off for an extended period of time, but I promise the new forums will be a billion times better. I'm pretty sure of it.

See you all on the other side in a few days, and if you have any (non-technical) questions, please e-mail me at kirupa@kirupa.com. For technical questions, try to find a tutorial that corresponds to what you are looking for and post in the comments section of that page.

Cheers,
Kirupa

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