#include <stdio.h>
int main()
{
printf("Hello World\n");
return 0;
}
This is my simple hello world program given to me by my professor. I was given this to copy as my first program in C. I am using visual studio 2013 as instructed and I am on a Surface Book running windows 10. A classmate that is on the exact same setup runs this program just fine. Mine will build and when I run without debugging the console window opens and no text prints. I cannot find a solution online.
Make sure your program doesn't just finish and close the console so quickly that you cannot see anything. Try this:
#include <stdio.h>
int main()
{
printf("Hello World\n");
fflush (stdout); /* Make sure string is outputted to std output */
getchar(); /* waits for a key to finish */
return 0;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With