-
January 6th, 2013, 06:18 AM
#1
-
January 6th, 2013, 07:17 AM
#2
Re: What does this mean?
Originally Posted by aditya.manglik
cprintf(%c,196);
It means, that someone who wrote this line avoids to read the documentation.
Please, read MSDN:
http://msdn.microsoft.com/en-us/libr...71(VS.80).aspx
http://msdn.microsoft.com/en-us/libr...dt(VS.80).aspx
PS. If you are using some other compiler (non-Microsoft) - then tell us which one.
Victor Nijegorodov
-
January 6th, 2013, 12:08 PM
#3
Re: What does this mean?
As stated, this is an invalid statement. I presume you mean
Code:
cprintf("%c", 196);
This is a Posix function that formats and outputs to the console. With Microsoft Visual Studio since the 2005 release this is a depreciated function and _cprintf(..) should be used.
In your case this will output the ASCII character coresponding to the decimal equivalent of 196 to the console. The affect of this may vary depending upon which OS you are using (which you don't state). On a Microsoft OS from a console it will display a horizontal line of one character width.
-
January 6th, 2013, 12:42 PM
#4
Re: What does this mean?
Re my previous post. I hate 'magic numbers' in code. You might find below of use to make the code more readable (for Microsoft console).
Code:
#define CON_SL_TL 218 //Single top left
#define CON_SL_TR 191 //Single top right
#define CON_SL_BL 192 //Single bottom left
#define CON_SL_BR 217 //Single bottom right
#define CON_SL_VERT 179 //Single vertical
#define CON_SL_HOR 196 //Single horizontal
#define CON_SL_LT 195 //Single left tee
#define CON_SL_RT 180 //Single right tee
#define CON_SL_TT 194 //Single top tee
#define CON_SL_BT 193 //Single bottom tee
#define CON_SL_X 197 //Single cross
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|