CLion, how to use cin/scanf input?

I'm new to CLion and using the Ubuntu version. When I pressed the enter key in the console (to input a varible) it just moved a pointer down without doing anything. So here am I asking is there a pattern of keys that must be used or something else I am doing wrong?

int main (void) {
int total, count;
printf ("How many philosophers are eating?\n\n>> ");
scanf ("%d", &total);
...

2 comments
Comment actions Permalink

In this simple cin example I'm able to simply enter a value in the Run console window and press return.

 

1
Comment actions Permalink

hello

I have used the same code

but when I try to enter values

it is showing like the console is "This view is read only"

please help me solve this issue

 

0

Please sign in to leave a comment.