I'm new to programming, and I try to program a menu in C++. I want it to be in a while loop, breaking when ESC is pressed, but I want the character t ...
I'm new to programming, and I try to program a menu in C++. I want it to be in a while loop, breaking when ESC is pressed, but I want the character t ...
I have a problem with, i think, function INPUT. But i can't understand how to fix it [functions code] [valgrind message] tried to change some bl ...
I have the following code. It does work for every input i give other than a particular one. When i give anything and then followed by the EOF, for ...
I need to read a PPM file but I'm limited to only using getchar() but I'm running into trouble ignoring whitespaces. I'm using num=num*10+(ch-48); to ...
I'm trying to write a program which gets one or more input lines, and if one line is too long, it gets folded at a maximum number of chars. My approac ...
I have this noob question: In the code above, car_teste would receive the value '\n', right? To prevent this, we should clean the keyboard buffer, ...
I am doing my C assignment for colleage. The task is requiring the function uses getchar() to read input from user and save it to a char[] type variab ...
I know it might sound stupid but how can I exit this loop ? I'm reading a book and trying to do the following exercise: "Verify that the expression ...
I run the following simple C code. The output of code when I enter character A as input from keyboard is as follow: why this code print number 1 ...
I have been studying C language for some time now, and I have a certain bug that I can't seem to be able to fix. As part of my revision, I started co ...
Im trying to write a code that gets vowels from a string and replaces them with a "*" before outputting the changed string using the functions of getc ...
Is there more elegant way to do this task? Program asks user for integer and repeats if non-digital characters are entered. To exit loop two conditio ...
The following is getline implementation in K&R on page 29 , I don't understand why we need to do "i < lim - 1" here in the for loop. For cor ...
I would like to input 5 words one word at a time and then with that word print out each letter of the word. However, I enter a while loop and it looks ...
I am trying a simple exercise from K&R to append string2 at the end of string1 using pointers. In case of overflow i.e. buffer of string1 can't co ...
I have the following function that should loop and take multiple lines from the user (names and dates). The user needs to enter an empty line to stop ...
I'm new to programming and I'm trying to put a pause in my code before my while(1) loop in in my main(). The pause will be broken after the state of a ...
why there is no "*" in output? the input is : abcde[enter key] I was wondering that the abcd'\n' will be stored in buffer when i click the enter ke ...
I've written a small program to practice getting user input using getchar() and outputting it using putchar() in C. What I want my program to do: I w ...
Currently, I am doing a project in c language in which I have to write a while loop to constant receive either keyboard input or joystick input. The j ...