Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2644501
  • 博文数量: 416
  • 博客积分: 10220
  • 博客等级: 上将
  • 技术积分: 4193
  • 用 户 组: 普通用户
  • 注册时间: 2006-12-15 09:47
文章分类

全部博文(416)

文章存档

2022年(1)

2021年(1)

2020年(1)

2019年(5)

2018年(7)

2017年(6)

2016年(7)

2015年(11)

2014年(1)

2012年(5)

2011年(7)

2010年(35)

2009年(64)

2008年(48)

2007年(177)

2006年(40)

我的朋友

分类: C/C++

2010-05-17 14:37:05

参考:http://www.cppblog.com/xmoss/archive/2009/07/20/90680.aspx
http://hi.baidu.com/kang_liang/blog/item/168c9059a9a1ca2d2934f05f.html


#include "stdafx.h"
#include
#include
#include
#include

void simple_vas_fun(char* start,...)
{
    va_list arg_ptr;
    char* nArgValue = start;
    int nArgCount = 0;
    va_start(arg_ptr,start);
    do
    {
        ++nArgCount;
        printf("the %d the arg:%s\n",nArgCount,nArgValue);
        nArgValue=va_arg(arg_ptr,char *);
    }while(nArgValue != NULL);
    return;
}

void simple_va_fun(int start,...)
{
    va_list arg_ptr;
    int nArgValue = start;
    int nArgCount = 0;
    va_start(arg_ptr,start);
    do
    {
        ++nArgCount;
        printf("the %d the arg:%d\n",nArgCount,nArgValue);
        nArgValue=va_arg(arg_ptr,int);
    }while(nArgValue != -1);
    return;
}
void main()
{
    //simple_va_fun(100,-1);
    simple_va_fun(100,200,-1);
    simple_vas_fun("a100", "b200", NULL);
    getchar();
}
阅读(1900) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2010-05-19 11:12:10

./configure --libdir=/c/Program\ Files/Microsoft\ SDKs/Windows/v6.0A/lib \ --includedir=/c/Program\ Files/Microsoft\ SDKs/Windows/v6.0A/include \ --with-winapi=directx \ --with-dxdir=S:/sdk/DXSDK/9.0