Created
June 16, 2016 14:29
-
-
Save IS-BrianLian/3685d4847a15c3a623d413739b69c994 to your computer and use it in GitHub Desktop.
argc_argv
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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