Originally Posted by
maniac20
For me this is not working im getting "undefined reference to `WinMain@16' " error.
You have your compiler set up to compile the program as a windows program. You need to change your compiler's settings so it compiles as a console program. int main() is the first function a console program starts with, WinMain() is the first function a windows program starts with.
Originally Posted by
space-oddity
To print a backslash you must put a doublequote before it
Actually, you would use a backslash before it, not a double quote. The double quote will make the compiler think you've ended your text string and that is not what you want.
The backslash in a string makes the character immediately following it behave differently:
Code:
printf("\\"); /* prints \ */
printf("\"); /* this is an error, there is no ending quote for the string */
printf("\""); /* prints " */
printf("""); /* (note: 3 double quotes in a row) is an error. */
printf("\t"); /* prints the tab character */
printf("t"); /* prints t */
printf("\0"); /* prints the NULL character */
printf("0"); /* prints 0 */
etc.