Skip to content

Instantly share code, notes, and snippets.

View 8ayac's full-sized avatar
πŸ‘»
πŸ‘»

8ayac(Yoshinori Hayashi) 8ayac

πŸ‘»
πŸ‘»
View GitHub Profile

Keybase proof

I hereby claim:

  • I am 8ayac on github.
  • I am 8ayac (https://keybase.io/8ayac) on keybase.
  • I have a public key ASCW8Vu_Bmanw3o7ks9HIwSgXB0ppogutq8nMrFf4cASDAo

To claim this, I am signing this object:

@8ayac
8ayac / dynamic_type_argument.c
Last active September 12, 2017 07:17
C言θͺžγ§ε―ε€‰ηš„γͺεž‹γ‚’εΌ•ζ•°γ«ε–γ‚Œγ‚‹ι–’ζ•°γ‚’δ½œγ£γ¦γΏγ‚‹
#include <stdio.h>
#include <stdarg.h>
void DynamicTypeFunc(char *fmt, ...) {
va_list list;
va_start(list, fmt);
while(*fmt != '\0') {
switch(*fmt) {
case 's':
@8ayac
8ayac / dynamic_arguments02.c
Last active September 11, 2017 12:37
C言θͺžγ§ε―ε€‰ε€‹εΌ•ζ•°γ‚’ε–γ‚Œγ‚‹ι–’ζ•°γ‚’δ½œγ£γ¦γΏγ‚‹02
#include <stdio.h>
#include <stdarg.h>
void printDA(int num, ...) {
va_list list;
char *str;
va_start(list, num);
int i;
for(i=0; i<num; i++) {
@8ayac
8ayac / dynamic_arguments01.c
Last active September 11, 2017 12:37
C言θͺžγ§ε―ε€‰ε€‹εΌ•ζ•°γ‚’ε–γ‚Œγ‚‹ι–’ζ•°γ‚’δ½œγ£γ¦γΏγ‚‹01
#include <stdio.h>
#include <stdarg.h>
int sum(int num, ...) {
va_list list;
int sum = 0;
va_start(list, num);
int i;
for(i = 0; i < num; i++) {