Skip to content

Instantly share code, notes, and snippets.

@Ludo6431
Created June 4, 2011 13:07
Show Gist options
  • Save Ludo6431/1007891 to your computer and use it in GitHub Desktop.
Save Ludo6431/1007891 to your computer and use it in GitHub Desktop.
exemple de définition de structure
#include <stdlib.h>
#include <stdio.h>
#include "pion.h"
int main(int argc, char *argv[]) {
Pion p;
pion_init(&p);
printf("pion: %d\n", p.var);
return 0;
}
#include <stdlib.h>
#include "pion.h"
void pion_init(Pion *p) {
p->var = 0;
}
#ifndef _PION_H
#define _PION_H
typedef struct {
int var;
} Pion;
void pion_init(Pion *p);
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment