hello all, I am new to this forum and new to programming as you all will be able to tell by my question. So, I am going through the "Learn C on the Mac" book, and I am at the part that discusses backslash combinations. He says that "\r" will place the cursor back at the beginning of the same line and if followed by another printf() function the original line of text will be overwritten. So:
#include <stdio.h>
int main (int argc, const char * argv[]) {
printf( "0000000000\r" );
printf( "11111\n" );
return 0;
}
should actually only display the string within the second printf(). However, this does not work. It still prints both strings. Is this just a typo in the book and in the source code provided? Thanks for any help you can provide; I also welcome any advice you have for a wannabe programmer who is starting late in life for a career change. Thanks!
#include <stdio.h>
int main (int argc, const char * argv[]) {
printf( "0000000000\r" );
printf( "11111\n" );
return 0;
}
should actually only display the string within the second printf(). However, this does not work. It still prints both strings. Is this just a typo in the book and in the source code provided? Thanks for any help you can provide; I also welcome any advice you have for a wannabe programmer who is starting late in life for a career change. Thanks!