论坛: 编程破解 标题: cprintf()是什么?请教286. 复制本贴地址    
作者: xuehaiwuya [xuehaiwuya]    论坛用户   登录
  最近在读C程序的时候,偶数发现这样的一个函数,不知道它是干什么的?请各位高手指教。


地主 发表时间: 05-03-04 21:28

回复: onizuka [onizuka]   论坛用户   登录
不用斑竹了,我回答你
cprintf 是在你定义的窗口上进行格式文字输出,
printf  是普通的输出函数

B1层 发表时间: 05-03-05 21:03

回复: xuehaiwuya [xuehaiwuya]   论坛用户   登录
你能举个例子吗?


B2层 发表时间: 05-03-05 22:30

回复: 286 [unique]   版主   登录
Example

/* CPRINTF.C: This program displays
* some variables to the console.
*/

#include <conio.h>

void main( void )
{
  int      i = -16, h = 29;
  unsigned u = 62511;
  char    c = 'A';
  char    s[] = "Test";

  /* Note that console output does not translate \n as
    * standard output does. Use \r\n instead.
    */
  _cprintf( "%d  %.4x  %u  %c %s\r\n", i, h, u, c, s );
}


Output

-16  001d  62511  A Test



B3层 发表时间: 05-03-07 09:18

回复: xuehaiwuya [xuehaiwuya]   论坛用户   登录
多谢286, 小弟明白了。

B4层 发表时间: 05-03-07 20:59

论坛: 编程破解

20CN网络安全小组版权所有
Copyright © 2000-2010 20CN Security Group. All Rights Reserved.
论坛程序编写:NetDemon

粤ICP备05087286号