⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 varargs.c

📁 vc环境下的pgp源码
💻 C
字号:
 /*
  * @(#) varargs.c 1.1 91/09/01 23:08:45
  * 
  * This program can be used to verify that the stdarg.h file is set up
  * correctly for your system. If it works, it should print one line with the
  * text "stdarg.h works".
  */

#include <stdio.h>
#include "stdarg.h"

main(int argc, char *argv[])
{
    varargs_test("%s %s\n", "stdarg.h", "works");
}

varargs_test(char *fmt, ...)
{
    va_list ap;

    va_start(ap, fmt);
    while (*fmt) {
	if (strncmp("%s", fmt, 2) == 0) {
	    fputs(va_arg(ap, char *), stdout);
	    fmt += 2;
	} else {
	    putchar(*fmt);
	    fmt++;
	}
    }
    va_end(ap);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -