请问有没有printf的源代码?

ekin7913046 2003-08-21 11:50:55
要是没有能不能实现?
...全文
48 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
Dragon132 2003-08-21
  • 打赏
  • 举报
回复
int __cdecl printf (
const char *format,
...
)
/*
* stdout 'PRINT', 'F'ormatted
*/
{
va_list arglist;
int buffing;
int retval;

va_start(arglist, format);

_ASSERTE(format != NULL);

_lock_str2(1, stdout);

buffing = _stbuf(stdout);

retval = _output(stdout,format,arglist);

_ftbuf(buffing, stdout);

_unlock_str2(1, stdout);

return(retval);
}
ekin7913046 2003-08-21
  • 打赏
  • 举报
回复
我是说有没有printf的源代码?
Dragon132 2003-08-21
  • 打赏
  • 举报
回复
int __cdecl printf (
const char *format,
...
)
/*
* stdout 'PRINT', 'F'ormatted
*/
{
va_list arglist;
int buffing;
int retval;

va_start(arglist, format);

_ASSERTE(format != NULL);

_lock_str2(1, stdout);

buffing = _stbuf(stdout);

retval = _output(stdout,format,arglist);

_ftbuf(buffing, stdout);

_unlock_str2(1, stdout);

return(retval);
}
chon81 2003-08-21
  • 打赏
  • 举报
回复
不明白楼主什么意思,
什么没有啊.
alphasun 2003-08-21
  • 打赏
  • 举报
回复
Dragon132(Dragon) 的方法很好用。我一直用这样的方法。
如果你只是想实现一个变参数字符串格式化的话。

============================================================================
提问题时标题要简明扼要地说明问题内容,切忌使用"急","求救"之类不能说明问题的标题
http://www.betajin.com/alphasun/ 遇到问题可以给我发消息,给我发信息时请附带原帖地址
http://alphasun.free-host.com/
DocWizard C++程序文档自动生成工具 | Wave OpenGL | HttpProxy | AjaxParser词法分析
skywater 2003-08-21
  • 打赏
  • 举报
回复
没有。

69,371

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧