Skip to content
Snippets Groups Projects
Commit 2b648f9c authored by dario.genga's avatar dario.genga
Browse files

Add base of the project

This include :
- .gitignore
- README
- makefile
- Files (main, .c, .h)
parent 14d4221d
Branches
No related tags found
No related merge requests found
# Created by https://www.toptal.com/developers/gitignore/api/c,visualstudiocode
# Edit at https://www.toptal.com/developers/gitignore?templates=c,visualstudiocode
### C ###
# Prerequisites
*.d
# Object files
*.o
*.ko
*.obj
*.elf
# Linker output
*.ilk
*.map
*.exp
# Precompiled Headers
*.gch
*.pch
# Libraries
*.lib
*.a
*.la
*.lo
# Shared objects (inc. Windows DLLs)
*.dll
*.so
*.so.*
*.dylib
# Executables
*.exe
*.out
*.app
*.i*86
*.x86_64
*.hex
# Debug files
*.dSYM/
*.su
*.idb
*.pdb
# Kernel Module Compile Results
*.mod*
*.cmd
.tmp_versions/
modules.order
Module.symvers
Mkfile.old
dkms.conf
### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace
# Local History for Visual Studio Code
.history/
### VisualStudioCode Patch ###
# Ignore all local history of files
.history
.ionide
# Support for Project snippet scope
!.vscode/*.code-snippets
# End of https://www.toptal.com/developers/gitignore/api/c,visualstudiocode
# Custom gitignore for project
matrix
\ No newline at end of file
# progseq-matrix
# Matrices
7e travail pratique du cours de programmation séquentielle, 1er année (2021-2022).
- **Class** : Programmation séquentielle en C
- **Creation date** : 16 novembre 2021
- **Description** : 7e travail pratique
Matrices
\ No newline at end of file
## Makefile configuration
### Compile the project
> `make`
Use this command to compile the project.
### Clean the project
> `make clean`
Use this command to clean the project.
main.c 0 → 100644
/* Author : Dario GENGA
* Date : 13.10.2021
* Description : Template for a standard c file
*/
#include <stdio.h>
#include <stdlib.h>
// #include <math.h>
// #include <time.h>
#include "matrix.h"
int main() {
printf("Hello world!");
return EXIT_SUCCESS;
}
makefile 0 → 100644
LIB=-lm
CC=gcc -Wall -Wextra -g
matrix:matrix.o main.o
gcc $^ -fsanitize=address -o $@ $(LIB)
matrix.o: matrix.c matrix.h
$(CC) -c $< $(LIB)
main.o: main.c
$(CC) -c $< $(LIB)
clean:
rm -f *.o matrix
\ No newline at end of file
matrix.c 0 → 100644
/* Author : Dario GENGA
* Date : 15.11.2021
* Description : Manipulate an unidimensional array with dynamic memory allocation
*/
#include "matrix.h"
#include <stdio.h>
void swap(int *x, int *y)
{
int tmp = *x;
*x = *y;
*y = tmp;
}
matrix.h 0 → 100644
/* Author : Dario GENGA
* Date : 15.11.2021
* Description : Manipulate an unidimensional array with dynamic memory allocation
*/
#ifndef _MATRIX_H
#define _MATRIX_H
#include <stdio.h>
#include <stdlib.h>
void swap(int *x, int *y);
#endif
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment