Thread: buf buf buffer

  1. #1
    Unregistered
    Guest

    buf buf buffer

    Just wondering, when you mention buffer in your code, are you configuring a buffer that's part of stdio, or are you creating an additional one?

  2. #2
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    "buffer" is just a place to put stuff. Most of the posts here though are talking about an array of chars, making a buffer for a string.

    >char buffer[1024];
    A buffer, length 1024 bytes, for holding chars.

    there are other types, can you expand your question, or provide example code you want explained?
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  3. #3
    Unregistered
    Guest
    Hammer, you're using buffer as the name of a character array. Is it possible, and common, to reconfigure the buffer that is built into scanf, for example?

  4. #4
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    The system allocates it's own buffering for keyboard input, etc. You should look into the setvbuf function if you want to use your own custom buffer for these devices.
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

  5. #5
    Unregistered
    Guest
    Thank you, Sebastiani.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 16
    Last Post: 10-29-2006, 05:04 AM
  2. writing a pack-style function, any advices?
    By isaac_s in forum C Programming
    Replies: 10
    Last Post: 07-08-2006, 08:09 PM
  3. buffer contents swapping
    By daluu in forum C++ Programming
    Replies: 7
    Last Post: 10-14-2004, 02:34 PM
  4. Tetris Questions
    By KneeGrow in forum Game Programming
    Replies: 19
    Last Post: 10-28-2003, 11:12 PM
  5. Console Screen Buffer
    By GaPe in forum Windows Programming
    Replies: 0
    Last Post: 02-06-2003, 05:15 AM