1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

how to read value directly into variable rather than buffer

Discussion in 'C' started by Kailash, Nov 20, 2007.

  1. Kailash

    Kailash New Member

    Joined:
    Jul 24, 2007
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    0
    Can anyone tell me what r the various function are available in c and C++ that read value directly into variable rather than buffer and please also give me some examples of these methods.
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,287
    Likes Received:
    364
    Trophy Points:
    83
    What is the difference between the two and can you please clarify what you mean by buffer and variable.
     
  3. Kailash

    Kailash New Member

    Joined:
    Jul 24, 2007
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    0
    first thing is that when we run a program it goes in to buffer. so that CPU can execute it fastly. and when ask for value from user, the value first goes into buffer and after pressing enter it goes into variable.

    bcoz buffer had limited size so when buffer overrun. In that case compiler gives error.
     
  4. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,287
    Likes Received:
    364
    Trophy Points:
    83
    But the buffer size is the variable size and so if you have sufficient variable size then you will not have the problem of overflowing.
     

Share This Page