Most voted "buffer" questions
In computer science, **buffer** (retainer) is a physical memory storage region used to temporarily store data while it is being moved from one place to another.
Learn more…34 questions
Sort by count of
-
13
votes6
answers35893
viewsKeyboard buffer cleaning after scanf
I’m having trouble with the job scanf();. When reading two or more values, the later values are not read. I’ve already tried: __fpurge(stdin); After reading, but in this case I need to enter after…
-
6
votes1
answer1726
viewsDifference 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?
-
5
votes3
answers5080
viewsClear C buffer with fflush() or __fpurge()
Studying strings in C I came across the following phrase: "Clearing the buffer, for example, is not always desirable, and for more professional and secure programming it is not recommended to use…
-
4
votes1
answer505
viewsWhat is an "output_buffer"?
Reading is reply, I had this doubt. What is a output_buffer ?
-
4
votes1
answer302
viewsCommentary count // and /* */ in C
I’m trying to make a little 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 it the following way: #include <stdio.h>…
-
4
votes1
answer161
viewsIs it possible to copy files without using a stream buffer?
In my application, I have a class that periodically performs a backup of a file, considerably small (less than 1MB), but I am doing some tests and after reading this answer, it seems to me that it…
-
3
votes4
answers1489
viewsCleaning the Buffer after getchar
Good Morning, I wanted to know how I can optimize the cleaning of the buffer when using the getchar() function, as an example follow the following codes: I get the following code to have the correct…
-
3
votes1
answer94
viewsHow to empty php buffer while running?
I want something printed on the screen during execution, and not only when the script is finished, I tried: <?php ob_start(); for($i = 0; $i < 5; $i++){ echo $i . '<br>'; ob_flush();…
-
3
votes0
answers114
viewsBuffer and/or C I2C problem
I’m hoping to get some help here. I am programming for Beaglebone Black using I2C sensors via the Eclipse IDE for C/C++ Developers, Version: Luna Service Release 2 (4.4.2). My problem is with code…
-
3
votes2
answers858
viewsKeydown + Enter event. Clear keyboard buffer
I created an example Winform C# . net containing textbox1, textbox2 and button1 to simulate the following situation: When starting the application, the textbox1 gets the focus and when we press…
-
2
votes1
answer909
viewsHow does buffer work using printf and scanf?
Using the printf, when I do: printf("\n\tQualquer coisa\n"); It inserts this first into a buffer and then prints to the screen (standard output) ? Using the scanf format %c, it captures from buffer…
-
2
votes1
answer725
viewsIs using %(limit)[ n] in scanf safe to capture strings?
I would like to know a totally safe way to capture strings without running the risk of buffer overflow or any other threat. I read a lot about ready-made functions and would like to know which ones…
-
2
votes1
answer330
viewsHow to go emptying PHP buffer while running
I’ve seen somewhere a code that configures PHP to go emptying the Buffer (print on screen) while running script without the need to wait all the execution for something to be displayed. Has anyone…
-
2
votes2
answers339
viewsString reading and input buffer
I always used the fgets() function to read keyboard strings, because it (at least I thought so) always clears the input buffer. However, I am finding some errors with the execution of the function…
-
2
votes1
answer684
viewsManage video with PHP
I’m setting up a file management system, but I’m having problems with displaying the videos. It has an interpreter and in a certain part I have a "ignorer". $mime = mime_content_type($path);…
-
2
votes0
answers487
viewsCalculate file size of a dataURL (cost)
I’m uploading an image to Base64 (dataURL) for an application that uses express. As the user is doing the "cropping" of this image on the front end I found no other way to send but by dataURL... the…
-
2
votes2
answers458
viewsError while clearing buffer in GCC (Ubuntu 18.04)
I was watching a tutorial of C, and appeared a part about buffer cleaning using the functions fflush and __fpurge. So far so good, but when I tried applying with __fflush, the GCC returns me the…
-
1
votes1
answer111
viewshow to force a buffer to behave like a string in C?
I am receiving a buffer from the internet, I believe that to go through this buffer and find the last character, you need to find the character ' 0'. But there is no ' 0' in a buffer. It is possible…
-
1
votes0
answers109
viewsHow to convert "arraybuffer" to "string" and vice versa?
I am making a mobile app in HTML5 and need to store data from MP3 files and bitmap images in Torage localStorage. The problem is that only to store String then I need to convert a buffer in String…
-
1
votes0
answers51
viewsOpen large images with python Opencv
I am working on a software that processes very large images, between 10GB and 30GB. The images are too heavy to open at once. I would like to know if there is any way to use Opencv to open the image…
-
1
votes1
answer309
viewsI have a bug in the scanf
I have to read N lines with one of the following 3 formats: "P k": the letter P followed by k being k an integer number; "A k": the letter To followed by k being k an integer number; "Q": the letter…
-
1
votes2
answers1378
viewsRead java strings within a while or do-while repetition structure
How do I read java strings within a while or do-while? repeat structure without error and reads Code: package listas; import static java.lang.System.exit; import java.util.ArrayList; import…
-
1
votes1
answer31
viewsProblems with the Bufferstrategy
I am recreating a code from scratch, but when creating a Bufferstrategy to draw on the screen I come across the following error in the console "Exception in thread "Thread-0"…
-
1
votes0
answers62
viewsDifference between string size in Standard C and C++
I compiled the following code in C Standard and C++: #include <stdio.h> #include <string.h> char string[5] = "hello"; int main(void) { printf("string tem %lu bytes\n", sizeof(string));…
-
0
votes1
answer114
viewsTransferring image via socket, image turns black
My server sends a command to the client and the client sends a Printscreen to the server using this code: Image printScreen = new Bitmap(monitorWidth, monitorHeight); Graphics graphics =…
-
0
votes1
answer3668
viewsHow do I use fgets instead of gets?
before "talking" about my problem, first look at my code and ignore the accent errors in the console if you are going to run. #include <stdio.h> #include <stdlib.h> #include…
-
0
votes0
answers167
viewsRead Entire with Bufferedreader on Android
In an Android application, I have a java socket client that sends integers (using writeInt) to a socket server on Android that I’m trying to read these integers. I receive correct strings but I…
-
0
votes0
answers608
viewsAvoid memory overflow in a PHP function
Guys, I’m opening here and I have the following problem: I created a function with a hint that I found right here in stackoverflow. function DozenGenerate($game,$dozen) { $this->game = $game;…
-
0
votes1
answer72
viewsJava Server Application Client loops
I’m developing a system for school reinforcement simple functions. At the time I went to implement my class that makes the data encryption needed to change also the type of data that will traffic…
-
0
votes1
answer18
viewsHow to "rebuild" a file from the buffer stored in the database?
I’m in great doubt. I upload files and receive them on a Node server with the help of middleware multer, the data comes something like this: Then I take this file and save in the database the result…
-
0
votes1
answer297
viewsC CHAR reading that works with %s but not with %c, why? And how does INCREMENT work on a pointer?
I hosted the code complete in the Pastebin: https://pastebin.com/feKaxAiz. It is a matrix where it is possible to perform the SUMMING UP or AVERAGE of the elements above the MAIN DIAGONAL. It is…
-
-1
votes1
answer210
viewserror while trying editText.setSelection
I am trying to apply a mask to my Edittext, but when I try to enter a value beyond what is allowed I get the error: 05-20 17:17:23.943: E/AndroidRuntime(1399): FATAL EXCEPTION: main 05-20…
-
-1
votes1
answer89
viewsBuffer Overflow
Good afternoon, folks, I’d like to request a hand on the college ATV; About this code used as an example: #include <stdio.h> #include <string.h> int main() { char…
-
-3
votes1
answer2212
viewsUnicodedecodeerror: 'utf-8' codec can’t Decode byte 0xd0 in position 0
line 1383, in <module> print(f.readline()) File "/usr/lib/python3.8/codecs.py", line 322, in decode (result, consumed) = self._buffer_decode(data, self.errors,…