"depot M111"
This commit is contained in:
20
Demo_make/M111_point.c
Executable file
20
Demo_make/M111_point.c
Executable 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
14
Demo_make/M111_point.h
Executable 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
11
Demo_make/Makefile
Executable 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
20
Demo_make/main.c
Executable 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;
|
||||
}
|
Reference in New Issue
Block a user