C Programming, Visual Studios 2012

Hello, I have the following code taken from a book:



main () {

char buchstabe_1, buchstabe_2, buchstabe_3; printf("Geben Sie den 1.Buchstabe ein: \n"); scanf_s("%c",&buchstabe_1); fflush(stdin); printf("Geben Sie den 2.Buchstabe ein: \n"); scanf_s("%c",&buchstabe_2); fflush(stdin); printf("Geben Sie den 3.Buchstabe ein: \n"); scanf_s("%c",&buchstabe_3); fflush(stdin); printf("\nSie haben eingegeben: %c %c %c\n",buchstabe_1, buchstabe_2, buchstabe_3); system("PAUSE"); 


The read characters are not output. I use the Visual Studio 2012 program (the program code is for VS 2010). I now do not know where my mistake is ... also find nothing useful on the Internet

Thank you very much

The best answer

As #include you need only <stdio.h>

Then, a "void" or "int" must before your "main ()".
Just use void then you need not return a value.

From scanf_s you doing scanf.

Then everything should work

Date: 2019-02-11 Views: 0

Related articles



Copyright (C) 2019 m3tch.com, All Rights Reserved.

M3tch all rights reserved.

processed in 0.161 (s). 10 q(s)