Skip to main content
Stack Overflow
  1. About
  2. For Teams
Filter by
Sorted by
Tagged with
1 vote
0 answers
74 views

I'm learning C and wrote a simple program in CLion that echoes '1' for every character read until EOF. However, the actual output doesn't match expectations. Code: #include <stdio.h> int main() ...
joyappre's user avatar
-1 votes
3 answers
193 views

When I see code for getting input I see scanf() used most of the time. I see some from the link taking-string-input-space-c-3-different-methods and I also see it on this website. Is there something ...
Chill Dog's user avatar
0 votes
0 answers
57 views

I am trying to make the simplest timer program in C. My attempt is as follows: #include <stdio.h> #include <time.h> int main() { char c; time_t start, end; long int day, ...
1 vote
2 answers
141 views

I am having a problem with my program getting stuck on waiting for input after using getchar(). I used a loop to clear the buffer and the same functionality appears four times in my program but only ...
Hexe Decima's user avatar
1 vote
1 answer
99 views

i'm currently going through K&R. right now i'm at exercise 1-18: "Write a program to remove trailing blanks and tabs from each line of input, and to delete entirely blank lines.". ...
Roee Zamir's user avatar
3 votes
3 answers
171 views

A number guessing C program; After the 4th iteration which prompts "well, is it 5 then?", the character \n (enter) still remains in the buffer which then gets read by the first getchar() in the while ...
4 votes
5 answers
172 views

I have just started the K&R book. It introduces a loop using getchar() and putchar() to copy characters from input to output until EOF is reached: main() { int c; while ((c = getchar()) !=...
3 votes
2 answers
191 views

I'm writing a test application for a console text input library. The idea of that part of the library is to just treat any input as a regular text input, even Ctrl+[letter] combinations. And for the ...
RobinLe's user avatar
  • 41
0 votes
0 answers
32 views

I am new to C language coding, I was trying to learn the various inputs that I can take from the user and display the same but I keep getting a blank in the place of the printf statement that takes ...
2 votes
1 answer
129 views

While developing a line editor in C++, I'm using getch() to capture each key input, and see \r(13 in ASCII) as the Enter key. However, when pasting text that contains multiple lines, the program ...
0 votes
1 answer
131 views

My code is extremely simple, but I figure that's best to figure out what's going on in my program. For some reason, I can't seem to get ungetc() to work properly, nor can I figure out it's purpose. ...
-1 votes
2 answers
141 views

i am making a counting program, and i want to add a feature that quits the program, but i don't really know how to do it. i have seen examples on how to do it, but all of them are for windows. please ...
0 votes
0 answers
67 views

I am just trying to copy and paste the text input. After which the code must show done. #include <stdio.h> /*code to copy all input characters and paste it one by one*/ int main() { int c; ...
-1 votes
1 answer
108 views

#include <stdio.h> int main() { int c; for (int i = 0; i < 10; i++) { c = (getchar() != EOF); printf("%d\n", c); } printf("As we can see, the value of c is ...
3 votes
1 answer
100 views

I'm getting crazy with C. I'm programming with JavaScript, Ruby, Python, PHP, Lua, even Java... Recently, I tried to program a simple Read-Eval-Print-Loop in C. And I have a very strange behavior with ...
Xitog's user avatar
  • 119

15 30 50 per page
1
2 3 4 5
...
64

AltStyle によって変換されたページ (->オリジナル) /