Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- ============================================================================
- Name : H59.c
- Author : Julian
- Version : 1.0
- Copyright : no-copyright (free code snippet)
- Description : Struct 1.0
- ============================================================================
- */
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- /* #include <math.h> */ // Pas utile
- int main(void) {
- struct test1 {
- char N[120]; // Le nom du personnage
- char S[50]; // Son sexe (H/F)
- int A; // Son age
- };
- struct test1 p1; // Création de personnage n°1/1 de notre structure
- printf("\nEntrez le nom de la premiere personne: "); scanf("%s",&p1.N);
- printf("\nSon sexe: "); scanf("%s",&p1.S); printf("\nEt son age: "); scanf("%d",&p1.A);
- printf("\nLa première personne s'appelle %s, est un(e) %s et a %d d'age.\n",p1.N,p1.S,p1.A);
- halt();
- return 0;
- }
- void halt(int haltvar) { // Fonction secondaire
- printf("tap on any key then tap on 'enter' to continue... ");
- scanf("%d",&haltvar);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement