Questions tagged as 'buffer'

5
answers

Keyboard buffer cleaning after scanf

I'm having problems with the scanf(); function. When reading two or more values, subsequent values are not read. I've already tried: __fpurge(stdin); After doing the readings, but in this case, I need to give an enter after each...
asked by 15.03.2014 / 18:25
1
answer

Difference between fflush and setbuf

What is the difference between the functions fflush(stdin); and ** setbuf(stdin, NULL);** ? When to use and when not to use each?     
asked by 12.11.2016 / 15:33
1
answer

What is an "output_buffer"?

Reading is answer , this question came to me. What is a output_buffer ?     
asked by 17.02.2017 / 19:47
1
answer

Is it possible to copy files without using stream buffer?

In my application, I have a class that periodically backs up a pretty small (less than 1MB) file, but I'm doing some testing and after reading this answer , it seems to me that it has been suggested that you can make copies without having to us...
asked by 05.12.2016 / 11:58
1
answer

Comment count // and / * * / in C

I'm trying to do a program in C that opens a file .txt , .c or any other in read mode, to count the comments made with // or /* */ . I'm doing the following way: #include <stdio.h> #include <string.h> #i...
asked by 29.11.2015 / 18:47
3
answers

Clear C buffer with fflush () or __fpurge ()

Studying strings in C I came across the following phrase: "Cleaning the buffer, for example, is not always desirable, and for more professional and safe programming it is not recommended to use fflush for example." Why using the fflush()...
asked by 04.02.2016 / 15:24
4
answers

Buffer Cleanup after getchar

Good morning, I wanted to know how I can optimize buffer cleaning when using the getchar () function, as an example follow the following codes: I get the following code from the correct output using the "scanf spacing" technique as shown:...
asked by 11.12.2014 / 18:03
1
answer

How to empty php buffer during execution?

I want something to print on the screen at runtime, not just when the script is finished, I tried: <?php ob_start(); for($i = 0; $i < 5; $i++){ echo $i . '<br>'; ob_flush(); flush(); sleep(3); } but did not work,...
asked by 01.03.2017 / 19:39
2
answers

KeyDown Event + Enter. Clear keyboard buffer

I created an example WinForm C # .net sample containing textbox1 , textbox2 and button1 to simulate the following situation: When you start the application, the textbox1 gets the focus and when we press Enter , its...
asked by 30.04.2015 / 14:13
0
answers

Problem with buffer and / or I2C in C

I hope to get some help here. I'm programming to Beaglebone Black using I2C sensors through the Eclipse IDE for C / C ++ Developers, Version: Luna Service Release 2 (4.4.2). My problem is with code development for I2C, especially between the...
asked by 17.04.2015 / 16:47