D
D
Dmitry Korolev2017-11-23 15:28:04
C++ / C#
Dmitry Korolev, 2017-11-23 15:28:04

How to install visual studio SI correctly?

I found on the Internet that it is enough to create a project in ++ and create a .c file in it.
Is this right?
While the second scanf kicks out in this code in the studio (as if it doesn’t exist), compared to GNU C

char ch1, ch2;
  scanf("%c", &ch1);
  printf("%d\n", fflush(stdin));
  scanf("%c", &ch2);
  printf("%c  %c\n", ch1, ch2);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Dubrovin, 2017-11-23
@z3apa3a

If you type a character and enter, then the first scanf will return the character, the second scanf will return '\n'. Even in Visual Studio, even in GNU C, because you entered it and scanf works with buffered input.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question