Created
June 4, 2011 13:07
-
-
Save Ludo6431/1007891 to your computer and use it in GitHub Desktop.
exemple de définition de structure
This file contains 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 <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; | |
} |
This file contains 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 <stdlib.h> | |
#include "pion.h" | |
void pion_init(Pion *p) { | |
p->var = 0; | |
} |
This file contains 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
#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