Asem Hamidasem-hamid.hashnode.dev·Jul 3, 2024Input Buffer in CWhen using scanf to read input in C, the function reads the input up to the first whitespace character, which is usually a newline character '\n'. When reading a char immediately after reading other types (such as int or float), the leftover newlin...Discussinput buffer
SAHIL ALIthestarsahil.hashnode.dev·Jan 28, 2024Why using scanf() instead of fflush()Absolutely! Imagine the data flowing through your computer like a rushing river. This river has hidden pockets called buffers, where information rests for a moment before moving on. scanf() is like a fisherman standing on the riverbank, casting a net...Discussfflush()
Jyotiprakash Mishrablog.jyotiprakash.org·Dec 24, 2023You want to input a string with spaces?When you want to read a string that may contain spaces from the console in C, using scanf alone may not be sufficient because scanf stops reading when it encounters a space character. Here are a few alternative approaches to read a string with spaces...Discussstring with spaces
Rahul Goyalrhgoyal.hashnode.dev·Jul 11, 2022scanf() is lousy!!Issue ❌ scanf() is a very lousy function 😪 due to which it can cause many runtime errors and even security issues📢 in our code that are very very difficult to catch.😨 A scanf looks like: scanf("%s", food); Now here, when a user enters input, he ca...Discuss·220 readsMemory Leak