Skip to content

Instantly share code, notes, and snippets.

@BrianLian
Created June 16, 2016 14:29
Show Gist options
  • Save BrianLian/3685d4847a15c3a623d413739b69c994 to your computer and use it in GitHub Desktop.
Save BrianLian/3685d4847a15c3a623d413739b69c994 to your computer and use it in GitHub Desktop.
argc_argv
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
void CLI_TMP(char *msg, ...)
{
va_list argptr;
int a,b;
char *c;
va_start(argptr, msg);
a = va_arg (argptr,int);
b = va_arg (argptr,int);
c = va_arg (argptr,char*);
va_end(argptr);
printf("%s\n",msg);
printf("%d,%d,%s\n",a,b,c);
}
int main(int argc, char *argv[])
{
CLI_TMP("This is Msg.",10,-10, "String");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment