"depot M111"

This commit is contained in:
JunkJumper
2020-05-03 14:10:04 +02:00
parent 0e8d905c4e
commit 78cdd39ea9
54 changed files with 610 additions and 0 deletions

20
Demo_make/M111_point.c Executable file
View File

@ -0,0 +1,20 @@
// M111 - TP10_PROG-PROC
// Composant M111_point
// Implementation
#include <stdio.h>
#include "M111_point.h"
lePoint lePointCreation (int x, int y, char nom) {
lePoint localPoint;
localPoint.champX = x;
localPoint.champY = y;
localPoint.champN = nom;
return localPoint;
}
void lePointAfficher (lePoint unPoint){
printf ("[ %c (%3d, %3d ) ]\n", unPoint.champN,
unPoint.champX, unPoint.champY);
}

14
Demo_make/M111_point.h Executable file
View File

@ -0,0 +1,14 @@
// M111 - TP10_PROG-PROC
// Composant M111_point
// Header
typedef struct {
int champX;
int champY;
char champN;
}
lePoint;
lePoint lePointCreation (int x, int y, char nom);
void lePointAfficher (lePoint unPoint);

11
Demo_make/Makefile Executable file
View File

@ -0,0 +1,11 @@
CFLAGS = -Wall -std=gnu99 -g
EXECUTABLES = crash \
crash2
all : ${EXECUTABLES}
clean :
@rm -f core *.o *.out *~
@rm -f ${EXECUTABLES}

20
Demo_make/main.c Executable file
View File

@ -0,0 +1,20 @@
// M111 - TP10_PROG-PROC
// Programme de test du composant M111_point
#include <stdio.h>
#include <stdlib.h>
#include "M111_point.h"
int main()
{
printf("Hellu world!\n");
lePoint pointA, pointB;
pointA =lePointCreation(10,20, 'A');
pointB =lePointCreation(100,200, 'B');
lePointAfficher(pointA);
lePointAfficher(pointB);
return 0;
}