C标准库源代码,能提高对C的理解,不错的哦

源代码在线查看: printf.c

软件大小: 1708 K
上传用户: sfdong
关键词: 标准库 源代码
下载地址: 免注册下载 普通下载 VIP

相关代码

				/***
				*printf.c - print formatted
				*
				*       Copyright (c) 1985-1997, Microsoft Corporation. All rights reserved.
				*
				*Purpose:
				*       defines printf() - print formatted data
				*
				*******************************************************************************/
				
				#include 
				#include 
				#include 
				#include 
				#include 
				#include 
				#include 
				
				/***
				*int printf(format, ...) - print formatted data
				*
				*Purpose:
				*       Prints formatted data on stdout using the format string to
				*       format data and getting as many arguments as called for
				*       Uses temporary buffering to improve efficiency.
				*       _output does the real work here
				*
				*Entry:
				*       char *format - format string to control data format/number of arguments
				*       followed by list of arguments, number and type controlled by
				*       format string
				*
				*Exit:
				*       returns number of characters printed
				*
				*Exceptions:
				*
				*******************************************************************************/
				
				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);
				}
							

相关资源