I am beginner in C so I don´t really see my fault here but my programm just skips all printf and starts with the scanf. What did I do wrong? I replaced scanf with fgets but the same thing happens.
Here´s my code:
#include <iostream>
using namespace std;
int main() {
printf("What is your name? \n");
char name[20] ;
printf("My name is: \n");
fgets(name, 20 , stdin);
printf("Your name is %s", name);
return 0;
}
Here´s my code:
#include <iostream>
using namespace std;
int main() {
printf("What is your name? \n");
char name[20] ;
printf("My name is: \n");
fgets(name, 20 , stdin);
printf("Your name is %s", name);
return 0;
}