User Profile

Collapse

Profile Sidebar

Collapse
constablebrew
constablebrew
Last Activity: Dec 2 '10, 02:43 AM
Joined: Jun 1 '10
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • constablebrew
    replied to How to answer Printf Interview question
    in C
    My intentions were to avoid multiple printf calls. I don't understand why, but I have been told in the past that system calls should always be reduced to as few as possible.
    See more | Go to post

    Leave a comment:


  • constablebrew
    replied to How to answer Printf Interview question
    in C
    As I understand it, the following should be well defined:
    Code:
    void main()
    {
     int i = 5;
     printf(" %d ", ++i);
     printf(" %d ", i++);
     printf(" %d ", --i);
     printf(" %d ", ++i);
    }
    However, would there be a better way of doing this? Maybe this way?:
    Code:
    void main()
    {
     int i = 5;
     int j = ++i;
    ...
    See more | Go to post

    Leave a comment:


  • constablebrew
    started a topic global getline vs istream::getline()
    in C

    global getline vs istream::getline()

    Why is the string version of getline() a global function while the char* version is part of the istream objects? I don't understand the reasoning behind this separation. Why isn't the string version simply an overloaded version of istream::getlin e()?

    This oddity has tripped me up several times, I tend to forget to use the global function and use the istream version.
    See more | Go to post
No activity results to display
Show More
Working...