From aceb7ebdb8b96024898b4cf80cf081f47e04fcb9 Mon Sep 17 00:00:00 2001 From: Ninjdai Date: Tue, 22 Oct 2024 13:03:17 +0200 Subject: [PATCH] Initial commit --- TP1/part_1.c | 131 ++++++++++++++++++++++++++ TP1/part_2 | Bin 0 -> 16216 bytes TP1/part_2.c | 148 ++++++++++++++++++++++++++++++ TP1/part_3 | Bin 0 -> 15840 bytes TP1/part_3.c | 70 ++++++++++++++ TP1/part_3.h | 24 +++++ TP2/part_1/concatenate | Bin 0 -> 15896 bytes TP2/part_1/concatenate.c | 34 +++++++ TP2/part_1/copied.log | 2 + TP2/part_1/copy | Bin 0 -> 15896 bytes TP2/part_1/copy.c | 35 +++++++ TP2/part_1/dummy.log | 2 + TP2/part_1/dummy_append.log | 16 ++++ TP2/part_1/dummy_novowels.log | 2 + TP2/part_1/dummy_novowels.log.bak | 2 + TP2/part_1/rm_vowels | Bin 0 -> 16000 bytes TP2/part_1/rm_vowels.c | 36 ++++++++ TP2/part_1/tableau | Bin 0 -> 15608 bytes TP2/part_1/tableau.c | 19 ++++ TP2/part_1/tableau_output | Bin 0 -> 2048 bytes TP2/part_3/out | 1 + TP2/part_3/serialization | Bin 0 -> 15992 bytes TP2/part_3/serialization.c | 56 +++++++++++ TP3/decoupage | Bin 0 -> 15688 bytes TP3/decoupage.c | 83 +++++++++++++++++ TP3/stringprinter | Bin 0 -> 15704 bytes TP3/stringprinter.c | 31 +++++++ TP3/test | 1 + TP4/ex_4 | Bin 0 -> 15696 bytes TP4/ex_4.c | 74 +++++++++++++++ TP4/union_ex1 | Bin 0 -> 15592 bytes TP4/union_ex1.c | 29 ++++++ TP4/union_ex3 | Bin 0 -> 15480 bytes TP4/union_ex3.c | 15 +++ 34 files changed, 811 insertions(+) create mode 100644 TP1/part_1.c create mode 100755 TP1/part_2 create mode 100644 TP1/part_2.c create mode 100755 TP1/part_3 create mode 100644 TP1/part_3.c create mode 100644 TP1/part_3.h create mode 100755 TP2/part_1/concatenate create mode 100644 TP2/part_1/concatenate.c create mode 100644 TP2/part_1/copied.log create mode 100755 TP2/part_1/copy create mode 100644 TP2/part_1/copy.c create mode 100644 TP2/part_1/dummy.log create mode 100644 TP2/part_1/dummy_append.log create mode 100644 TP2/part_1/dummy_novowels.log create mode 100644 TP2/part_1/dummy_novowels.log.bak create mode 100755 TP2/part_1/rm_vowels create mode 100644 TP2/part_1/rm_vowels.c create mode 100755 TP2/part_1/tableau create mode 100644 TP2/part_1/tableau.c create mode 100644 TP2/part_1/tableau_output create mode 100644 TP2/part_3/out create mode 100755 TP2/part_3/serialization create mode 100644 TP2/part_3/serialization.c create mode 100755 TP3/decoupage create mode 100644 TP3/decoupage.c create mode 100755 TP3/stringprinter create mode 100644 TP3/stringprinter.c create mode 100644 TP3/test create mode 100755 TP4/ex_4 create mode 100644 TP4/ex_4.c create mode 100755 TP4/union_ex1 create mode 100644 TP4/union_ex1.c create mode 100755 TP4/union_ex3 create mode 100644 TP4/union_ex3.c diff --git a/TP1/part_1.c b/TP1/part_1.c new file mode 100644 index 0000000..40f3c45 --- /dev/null +++ b/TP1/part_1.c @@ -0,0 +1,131 @@ +#include +#include +#include + +#define TAB_SIZE 7 + +void afficheTab(int tab[], int size); +int* fibonacci(int n); +void print_sizes(); +void exercice_4(); +int est_permutation(int* tab, int n); +int * permutation(int n); +char * appliquer_permutation(char * T, int * permutation, int n); + +int main(int argc, char *argv[]) +{ + /*int i; + + int *tab = fibonacci(TAB_SIZE); + int * tabptr = tab; + + afficheTab(tab, TAB_SIZE); + printf("\n\n"); + */ + //print_sizes(); + //exercice_4(); + + // int tab[8] = {0, 1, 2, 3, 4, 5, 6, 7}; + // printf("%d\n", est_permutation(tab, 8)); + + /*int * tab = permutation(TAB_SIZE); + afficheTab(tab, TAB_SIZE); + char bliat[TAB_SIZE] = "Bonjour"; + + char * bliat_perm = appliquer_permutation(bliat, tab, TAB_SIZE); + for (int i=0; i69U0Rn3YbQsXqC^BY?3WWHf}Z&oM5qO z(e09H)DAF~=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!?Xoqi zO0fAHw+%C3m@CSctqGV$X}L02uD*TwveoA8D^}bQSZA(VwtRKK)SK!3vg4h$wDZRL zG;G+$dRvSA@L#kCJ{qp6jhWF%OmF44z4X@kP*pG%RJ1KWjBwNU_}iAnyj$M}$Tip; zi&Tf}>dY8zv=260+x*i^Op|K2Hs251iEmalMa)`!89=-ASKSV)s&IqZ+!U(PpA)22 zWPMtY2ALszQ=mU0kN`}4P>_zG%}q^B+`j%4Av0+06N`p}4K;NkvoVOT5bEIN{3gL} z^(H+`)EX@Ck%1XlTWWsMCk5$WJlOT0W>#06pQ!HxnS}CD3p=hJ>HAG?| zUrj@^uQ3{F3`JvG9nhxcFh1`IS246~`Knp5V2#q|wZW!Z<*VA-fF>*+i&~loLeZvh zq#;c(p^Jvj`*SxJ!5>KTC+MDtPh#BRqz$b@-TzZXb^#t zhm=uqus&RgRxuCh@WFOUN&UDkVRpc{;xto?Ti0N-)WBIe>}tg zIj?0Yd@oh*AQ?Y_{(wRO4!&&d@4e(Z&P;oeh5re@Snb;W^1RwJ3m{1BENMs<{4^9a zccguJez3pG<@jY7#ZShO){SH${_>q!=WKwW85Xn8;xC-muTFn?9!au)t?g+Q#7{V_ zvz-2Ae#@?`$l?;GB@Ol8mf=iwN&FlAmS!XSOFLpuZ8?dy^b*GAwo3fz{_Z64cXF9~ yPP;u^;Q$9l_hA|*iAV0AV}VKRPX9-XEoojx< +#include +#include + +#define NB_LIGNES 9 +#define NB_COLONNES 3 + +float ** tableau(int n, int m); +void autofill_tableau(float** tab, int n, int m); +void autofill_tableau_int(float** tab, int n, int m, int v); +void fill_tableau(float** tab, int n, int m); +void print_tableau(float** tab, int n, int m); +void print_tableau_int(float** tab, int n, int m); +float ** right_rot(float** tab, int n, int m); + +/* +* Libère le tableau +* n: nombre de lignes du tableau +*/ +void free_tab(float** tab, int n); + +float ** triangle_pascal(int size); + +#define PASCAL 5 + +int main(int argc, char *argv[]) { + srand(time(NULL)); + + float ** tab = tableau(NB_LIGNES, NB_COLONNES); + autofill_tableau(tab, NB_LIGNES, NB_COLONNES); + //fill_tableau(tab, NB_LIGNES, NB_COLONNES); + print_tableau(tab, NB_LIGNES, NB_COLONNES); + + printf("\n\n"); + + float ** rot_tab = right_rot(tab, NB_LIGNES, NB_COLONNES); + print_tableau(rot_tab, NB_COLONNES, NB_LIGNES); + + free_tab(tab, NB_LIGNES); + free_tab(rot_tab, NB_COLONNES); + /*float ** t = triangle_pascal(PASCAL); + print_tableau_int(t, PASCAL, PASCAL);*/ + return 0; +} + +float ** triangle_pascal(int size) { + int i,j; + float ** tr = tableau(size, size); + autofill_tableau_int(tr, size, size, 0); + + tr[0][0] = 1; + for (i=1; i6~4P^QkN$7rXj7B0#$~<+qqSjc z*so9@R146)M$3#oX#iSNPDkfr4a?^NiC0gRDtNOID?y2nka$-rrzs#5LB-=B-h5JU zJBWKY4nfg-{^CSNiR-b+7y-Z=Au*v|HXiXT?@0>sUK$2`| z9MmV-P$3y@Qb;G8$leW7E^nw}xbzD0haitvu_xcv`k~uJHTmO^$FT)VEdhaI6tKn}=j@+_r|Yc{`VVJfp@6 z*}OBP$chf}2GzB>d*ddnDY35Et2QOpE33P2irX)Ju6h;wx|K=Ps69-&bJH%$s$Wo>rf}y@>h{aj zrm5t)Dc$}NwP^}@?gwa-zqNnuE}wcRRsK_I;>^XKzK*q1YmcW6v_1!tyYyo)e{(2N zxAI9)5YU0vG9;-3^PeENeb!luP;04sIa~yCaOS-=^)?_Y&N8DOJ9hI{deL zQio^fr6NaDr!F~5(7_)Prh^)HdZ=z?dxcN&?Q2~Mt}3nTPffJG3`>t+7Qi=D-P^C`!qW;e9hHXFkK%!%>)T6(dvzJ^qRqmKgO?J#4 zg8(j2JAQ<$COcv~bp__}RC(`Axpc;`UhuId`_GhnVqndrCN<8c$~`!Y)K11IIdxuR zvL8yerK;ggsslX{vN5VjH8C40Ei@!;Rr8Dq=(0F&t;9jz;MLgsxm5Rgkgm#m^_Yo; zFnOF6VXPwL!J9teW*FC?-(;}CzY^Tg_ha6Ij@+hotG1f0p zhGzzdvYM3eqSe>=)osF@gadRiv3FLLPN9>Tg~nwJ29=DI_g+YqOVg(76_t#@^Rbyb zaKyFdI4&da8uP9y3MVXK2Eq)483;2FW+2Q!n1L_@VFtnsgc*2mGeGa3w(nG{awWAY z{qeZk3HOoZ^X~i<@O{`8UUc0r0CxZ#VE=2b`y%kuz~2I&1ilGe_`2&Z!M^|x0-J$3 zU?1@FKnJ+u4cGk&a0zUwL>})|k?~k$`NC^!o?$t?>!1F+>wbg`+OO5G!frve8QVDI zJtVJ-B#Z^iM$F=+{4N`X^CX!VH8N2s037Ak09RfiMGM2Eq)48TkLofUE zA7C6}6nj}O+O=uZ9r4vzjeJ{tZF8b2u{Pe+*wozE(zsq-L3R7uM(LyqQr@mnuenuJ zRpoTPMAT9h9FIAD7klf;r9b*FAfj&c&KHs2g-W&c#ywY%k7#+VdY0GI?&ppiV4UlI z__LPRt9a5cRq7cutNA?yc}&%-#(@3vWFM_la($wy%lEOrLDj0Sa%cKK1IT{L@+`+m z3>f5Arm$oDET-Xz;MCdsN&HnZO*zTe5Yc^~8y zf6#s>a_DFURUPsXvb_wmkbcU>}#Ng=2NG4CW#{ap{`~#PW_iaKw|BwpG z{6id(t-pL24f@TOc|r^G1(SYb)MY*(V)~B7&mU*LApJk>FLHkqSvM+v{z2vo#>J2^ z$bS&>w=jp0_+?%tDC1wi{9ybxFEWo}q}&N#=091;C}iQwJWlXA==>#^ z|2HMc6e&sxP6EZRpzI^XBwT7&fT5Z7F3t#YUX#9M6?wVnKi^nt-;R!}T z_VeROV;65UC~=xrC4R3BGW8|#%lxd7`Qk_H$(O&-{F7vC?x}?D`>a{(gzrZ=_dGHx x!`xvb2S)c{I!+Rg+&^hvD6ymJm1ozP>I>qCHGwAP&ei!{>kZ)p0Yadu{sX~l +#include +#include + +Liste * create_list() { + Liste * list = malloc(sizeof(Liste)); + list->nb_elements_ = 0; + return list; +} + +int list_length(Liste list) { + return list.nb_elements_; +} + +void append(Liste * list, int val) { + Element * el = malloc(sizeof(Element)); + el->val_ = val; + el->prev_ = list->tail_; + + if (list->tail_ != NULL) { + list->tail_->next_ = el; + } + list->tail_ = el; + list->nb_elements_ += 1; + if (list->nb_elements_==1) { + list->head_ = el; + } +} + +void append_head(Liste * list, int val) { + Element * el = malloc(sizeof(Element)); + + list->head_->prev_ = el; + list->head_ = el; + list->nb_elements_ += 1; +} + +int first_value(Liste * list) { + return list->head_->val_; +} + +int last_value(Liste * list) { + return list->tail_->val_; +} + +void print_list(Liste * list) { + if (list->head_ == NULL) { + printf("[]\n"); + return; + } + Element* current_el = list->head_; + printf("["); + printf("%lu", (unsigned long)current_el); + while (current_el != NULL) { + printf("%d, ", current_el->val_); + current_el = current_el->next_; + } + printf("]\n"); +} + +int main(int argc, char *argv[]) +{ + Liste * list = create_list(); + + append(list, 69); + + print_list(list); + return 0; +} diff --git a/TP1/part_3.h b/TP1/part_3.h new file mode 100644 index 0000000..13e223e --- /dev/null +++ b/TP1/part_3.h @@ -0,0 +1,24 @@ + +typedef struct LListe Liste ; +typedef struct LElement Element ; + +struct LListe{ + int nb_elements_ ; + Element * head_ ; + Element * tail_ ; +} ; + +struct LElement{ + /** + * Element suivant / NULL si dernier element + */ + Element * next_ ; + /** + * Element pr´ec´edente + */ + Element * prev_ ; + /** + * Valeur stock´ee dans la cellule. + */ + int val_ ; +}; diff --git a/TP2/part_1/concatenate b/TP2/part_1/concatenate new file mode 100755 index 0000000000000000000000000000000000000000..b6001a10827081714e4050cb40b1574b0eba0355 GIT binary patch literal 15896 zcmeHOeQaA-6~A`cHDha%mW5_5G*6|iS|DzcrXgEN>wGwUnbME7DRdLt%d7ny8yq{c zUs|_XAuOX(h$q0>zArxS!;ztZU?3p4)rdU;wfP2xgvoHBlR6;6qD!oX z*Nx(B;x^D%NKDzoN`O_hYr%3^OLz@P^O};wvHBwo+d6=8|7UeMCT`td4UM`Si9;(P&Al?G;9ElS`J4wzb z<^+!}IuEZ5gAH3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)D_$D_%{TBdV z8-!15&-+S5GwG;lTWL5#P&wZJz=59qgMCoS4ev1{q8kH;d-g{Rz5lQ<_6;5E?HMu- z4h$TL3>(8ey+aWw^7hu6hq-Y4-xP~uA-m&?Mdq@ay$ms|m}#3-r(SM>QuZW_jdoRU zu4>xLojm2}Ml6>x5@tGvrRswRffq}rjftEUqr&-ewv~>lqWE&yIG)SVkg~L1R^FGn zsOtPO2y67q09ABf1{nqv(;JZk{l>p4oiDHCFAo4Yv4sfbPL0{-agcUa$prV3X(-tr z7ol_puJ&kpA~c?bf5B$$Q!eQEL=v7-NyZ53=^bpb%~2uU6J{Asg z$lyK%Hph}t7&Qa2;3XsnP{H6jiBL2%HfE(EEB|G~eG9yW;J@3dHPII^OWwDTS^9Dx z<=f%Fy#n*Qh|e+%Hh1HF1Y`KPoSUB~K1=*Rw!87?C1Zooar2)dK1+=qNqYJ31N<+r z_u%>SevBobKW$T-{Tqihp@Vxd=JS4yE-8qN{BeEz&|N&<#cW-QVPcZSi(ljJc{S$O&10|TBv^Q%2)SdD+x!=KcY zC(B2fNRqD~!#{-%R8`9N0Al>S6F-OO^=F;sFM)%5S9;qEzTdjmg3*@Oi_(^L=HosM z*ADY}|LZ(giphb7>mM8Qcpba~7`iZ@pR+3LKyP>sNeSnb`7B=ri<{5)Ym3BBI84=H z9?Kw*-F)7+9%@zoJWme8JVysIVm$wmu(FI0-|LTKx!Y +#include + +int main(int argc, char *argv[]) { + if (argc != 3) { + printf("Usage: copy \n"); + exit(-1); + } + + FILE * ogf = fopen(argv[1], "r"); + if (ogf==NULL) { + perror("Error while opening file1"); + } + + FILE * tf = fopen(argv[2], "a+"); + if (tf==NULL) { + perror("Error while opening file2"); + } + + fseek(ogf, 0, SEEK_END); + int ogf_size = ftell(ogf); + fseek(ogf, 0, SEEK_SET); + + char * f = malloc(sizeof(char) * ogf_size); + fread(f, sizeof(char), ogf_size, ogf); + + fwrite(f, sizeof(char), ogf_size, tf); + + fclose(ogf); + fclose(tf); + + return 0; +} + diff --git a/TP2/part_1/copied.log b/TP2/part_1/copied.log new file mode 100644 index 0000000..dabadf2 --- /dev/null +++ b/TP2/part_1/copied.log @@ -0,0 +1,2 @@ +UwU +Sussy Baka :3 diff --git a/TP2/part_1/copy b/TP2/part_1/copy new file mode 100755 index 0000000000000000000000000000000000000000..2de075f530a558264302b35bdb2f1bff087b17ec GIT binary patch literal 15896 zcmeHOeQX?85r2118kaV|x$Q2(7s1jC{NIodwh=NimS!Ujw zS??`(P$7gwwa?m{H@}(RytlLO_TKvD9*^{N1p@)WtwQV(sLj zysi`P61RcAOk&C&RsyW5T@4n?O2R8ZBCifRCFFey7A$#&D3MpLZJ_~J3OWzuEk_dR zURg`?V99o8JPpavH2LbtH%Vpb=3#E;>XpM>Td_P(dAUfEd8i_9o_O=bb0kg(?Iby$ zm=io&={&qL3^r_G`6`5$H%>gS>?D7dI0m-E*R9xpGTtHL9n)kO;guT|ELie*4+0PK z@>UyP<~|y)+;wQ6{IjIAitVZ7U`zA%RIEOgOplG%kGHnew={=xnNX9Q0?w-e4qQ|F z4;&G}36V#P`2i6q(u1Ufi)`q7HyoID&oD`c1p#$s|o05Fbr62Lq^VuW-VhRnoI*SG#)kL$#gW8e9RPa%S@$2d?=O4fpQ|7v_Rxc^CJR@ zxGG!3{+{lA9Y#~ADYVn+?`RfAcYm)DGqdJ!GH03D{@#vMCT;dd2U8}DGCYz=)3}Cm zE$Ju(tY28G>TjusI%>EEgJJ+AzwgG@ByY#n{b9ns_2~<634-D{=-Bvv$oHZADurLA z`yJz>gg+EkcE(xH?^QTnUtFWye&oXGEiO%SE_?+$gS_g(t6ccJ3$J$Jd?UpebnBGX z%CK@m-2FbSapCfFNV$nR7mnw^O$)0Y#^G~DWJ?%dg+LqLUIQ2ZhfA7k-Be z54-R?UAXST@xARgKLdUS{0#UR@H60N;O&=zKUJ^$t3LT!rG9q#ejsN)u?FfH|G zQOB)O;d4^|0_wOWDx8=4)2QQCs4yY*&!CRmn!>2mKZQDOi3$T!{{-r|6)GG89nYun z_uW%3e@LHtRiC`Jc&In%YWFbU%pwP2WIt`Z&`OkfYTJ9 z(w>i3ukT#qO?Kq-Owmpnped@ZkQa{@^3yNKYkv1$nLCTs)Il3k+JD4McJT13$nfwrhVRB1{9dsO$3JK^s~JSK)Cq= zE<7|_Vz&koAO2tbqiy$tv=(jq0gxj%Z2J^Q{0mt7 zd3dNp{607uz<)D3bgqzJEp3EuGaLzsH;s5zO;=Uj`>XFbQ8^*@uGzh9$Hol^Blj2_ z1>m>gLt=YX&6B~7mA6&224DyP{N`uC&w!r+KLdUS{0#UR@H60Nz|Vl6f&cFea2*}j z&EcaDwgLGngj4H9g?e1$Rf&a=(C$^jsn1(WIzKV3A)V{=@Hq<`+y8va&Y+&hhdyXr z>o!0gu5p_uJJ+hsDtEy(YFNjKtyT%=m1tst>hkbgMQn>oIM0*#g)z2!ln|{1Fg{Kb z;d$rDk8A39{J+`ie84PS;d@JYeme2t3stFep5bv*>YK^_2I)L+8s>j4xPII_a0{)2 zE|MQ087Fz1q=Sa?y=(a@PAqwor_yM3-|^% zK>Z&8zB&kZYtQ>i;D6~tP%_?m^gw%WcL&sP!<);9=tfsxdvCE~64DnfNZZh<}eEeMc z3+z33{=6S!$>&eo6led&VWZH&y%_U(zs7O`lM4;!h+RH^-Zv!y!znYL_kS#B!RBrh z&Ve3<9`3D}&-*Es8hP^k*^lMNz>a%0)_K3ilJ^+i`BPYN4my}q=JS4$Wu6>)eDC=` zMf`o_$NNu~i!MIyQN8@n1BN-__|E45eID?>oWlIm^?%00*NDe*nu#RI>9mK&Aoyn6Xp zz~bglXv&r4DTk>#eEk^y8FZkkQoaWe +#include +#include + +int main(int argc, char *argv[]) { + if (argc != 3) { + printf("Usage: copy \n"); + exit(-1); + } + + FILE * ogf = fopen(argv[1], "r"); + if (ogf==NULL) { + perror("Error while opening file1"); + } + + FILE * tf = fopen(argv[2], "w+"); + if (tf==NULL) { + perror("Error while opening file2"); + } + + fseek(ogf, 0, SEEK_END); + int ogf_size = ftell(ogf); + fseek(ogf, 0, SEEK_SET); + + char * f = malloc(sizeof(char) * ogf_size); + fread(f, sizeof(char), ogf_size, ogf); + + fwrite(f, sizeof(char), ogf_size, tf); + + fclose(ogf); + fclose(tf); + + return 0; +} + diff --git a/TP2/part_1/dummy.log b/TP2/part_1/dummy.log new file mode 100644 index 0000000..dabadf2 --- /dev/null +++ b/TP2/part_1/dummy.log @@ -0,0 +1,2 @@ +UwU +Sussy Baka :3 diff --git a/TP2/part_1/dummy_append.log b/TP2/part_1/dummy_append.log new file mode 100644 index 0000000..f75988b --- /dev/null +++ b/TP2/part_1/dummy_append.log @@ -0,0 +1,16 @@ +UwU +Sussy Baka :3 +UwU +Sussy Baka :3 +UwU +Sussy Baka :3 +UwU +Sussy Baka :3 +UwU +Sussy Baka :3 +UwU +Sussy Baka :3 +UwU +Sussy Baka :3 +UwU +Sussy Baka :3 diff --git a/TP2/part_1/dummy_novowels.log b/TP2/part_1/dummy_novowels.log new file mode 100644 index 0000000..17a8412 --- /dev/null +++ b/TP2/part_1/dummy_novowels.log @@ -0,0 +1,2 @@ +UwU +I'm a Sussy Baka :3 diff --git a/TP2/part_1/dummy_novowels.log.bak b/TP2/part_1/dummy_novowels.log.bak new file mode 100644 index 0000000..decfe29 --- /dev/null +++ b/TP2/part_1/dummy_novowels.log.bak @@ -0,0 +1,2 @@ +UwU +I'm Sussy Baka :3 diff --git a/TP2/part_1/rm_vowels b/TP2/part_1/rm_vowels new file mode 100755 index 0000000000000000000000000000000000000000..0d5ba5b87652b08da62ec001f2edcb2d67687f90 GIT binary patch literal 16000 zcmeHOe{d9c760A^N@$y0Ktcm(S&>@M$&rL4ra)lx-z<2d^=yYKrx?|r`C@4nsJ`)>B#=R#c_exFaUl!(m&t!#ybsOr#p<0gb#WY`Ez6TCiZvGenKNVse}YU@ho4kT)MmWIJ_; zI%UoN{CEnIK@_>q>nmikw(~GI)74hMbaSD8it_R_Y38Acycy!n5HGKBLg**W`NZkt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Nta`K-82OdB3i~XLl z7$4VRcK#m4ie&v6CX(j!$MA2VQ4SlYiJ#l}_m0kZwpsrHxB(lVpX)AH0|>%#mNjQH z{%3IDwZr4{x;p>+RXjKly#7&`$JYU_A2Eda{Cljabr>zg8cXH(%xC>3ccU@8zDZA!|^zlUCL;D3eUTkkN0=G zFyF5E+Ox+!O&w}9F}x4sdE)u-{c|B;Ja;=kyWX;{^FZWun6Nf?=fBcm5tcd#4paOS DA0;|B literal 0 HcmV?d00001 diff --git a/TP2/part_1/rm_vowels.c b/TP2/part_1/rm_vowels.c new file mode 100644 index 0000000..1426751 --- /dev/null +++ b/TP2/part_1/rm_vowels.c @@ -0,0 +1,36 @@ +#include +#include +#include + +int main(int argc, char *argv[]) { + if (argc != 2) { + printf("Usage: rm_vowels \n"); + exit(-1); + } + + FILE * file = fopen(argv[1], "r+"); + if (file==NULL) { + perror("Error while opening file"); + } + + fseek(file, 0, SEEK_END); + int file_size = ftell(file); + fseek(file, 0, SEEK_SET); + + char * f = malloc(sizeof(char) * file_size); + fread(f, sizeof(char), file_size, file); + + fclose(file); + file = fopen(argv[1], "w+"); + + for(int i = 0; i5 z$Bk1#aWO$zSw-Ls$V8|n{-LW0W{@t{C!s>Wer)G%|1DgZIjAu8d# zN8BUs0J}_bPJ7G&Xm!eRxEL#l-vWrbdaRVdyB%6E@(dACw`ti*EsS&>s4K@Nvi*39 z=E=zI?sy7{p(yg~;`3xOdUY6^rDn%rsk0bQ(|Acj)}e{I71FJc&PALMwi9wZF(!C) zP(1w@gElNNc^1O2n<1Sad&!>>$G~#(Wh?%lj5ka=MUmYIKQ=nFVC3;00v*QX-4?#h zBQ)M-_aRF0XQZ%-11a-Nd)t9jyg6m2r)QdHI@+7t+akG4q*YD<=M{wm*VMrAF%g~> z1>{&C5}_hHOg6a4g1$T9z_6qKqMjZ&+WznxCtI$*_{R2ak%p$9J&Hbf9oQ%OU_lNK zF4)EgbMFT0!D&Yc$1HG42_DBN<$rh+{)@mXaQF-MQL3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ew=&AEByK?ukRA+;m1{JbDZI0s~&$^{n-&TK`Dbu|7@h9TD2V z(24G@A?-we|H-~lZM3UE`d4c znuby*g&d6Hd~z+G%VpR}7{i~Gq;{5sI4&X8^AtJf+lMrq|E9+pAYmjSiWT!+Vow1C_M0z?hm4!6@ ztaaW)otZY_?-ypAsIKn8W=o$C(mko?k|Gj6pN1hEw6adiV@5V-X3|B525ng*rK5mq zQz=VCQZXnHoQ!$eWRb?8{1G{<4o4DHi=#u&7D z3%^e?*A5l0eungn`2DW8@biYbL8y53Pm`WeVMjv0{-eOZ1@Emqf8K8}^7Zq6!#{r= z^!Q%FdftyPuG6?UM~pM;d0$`xhf`)f?{64+KLakZU?1M{DKK#Fz6?BaKPdj7v7EA*H(g)>h z06G4=!2h%J`?JmXB50~Tdj34I+>E_#tQW`Huvz~qG~n8y$A-HfbpJPr!GVJ79}DaF zKE4SYy0D)A-&8n&-a_nmz&*2`@oi}F>iP4?D(O31rBh)YV;ICq(*!W<9*`!@bhyU ha6EU9T&%Y`)>$5i8hs}0WlQTn(dG!=?-Te;@lUG_8*Bgo literal 0 HcmV?d00001 diff --git a/TP2/part_1/tableau.c b/TP2/part_1/tableau.c new file mode 100644 index 0000000..2b1d998 --- /dev/null +++ b/TP2/part_1/tableau.c @@ -0,0 +1,19 @@ + +#include +int main(int argc, char* argv[]) { + if(argc!=2) { + printf("Usage: tableau "); + return -1; + } + + int T[512]; + for (int i=0;i<512;i++) { + T[i] = i; + } + + FILE * F = fopen(argv[1], "w+"); + + fwrite(T, sizeof(int), 512, F); + + return 0; +} diff --git a/TP2/part_1/tableau_output b/TP2/part_1/tableau_output new file mode 100644 index 0000000000000000000000000000000000000000..0980613d06cdba26ecc7db4d93e22581249f481d GIT binary patch literal 2048 zcmWmD(}EZV006M7ZQEUK+s0Pgwr$(CR@=61+qSvvA)k25Ry=Y zCJbQ-M|dI-kw`=)3Q>thbYc*bSi~j{afwHK5|EHYBqj+-Nk(%1A_XZ)MQYNJmUN^i z0~yIgX0ni#Y-A?~ImtzC@{pH&ag1jI6Pd(hrZAOhOlJl&nZ<18Fqe7E zX8{XY#J?W_xyE&FaFbiy<_>qc$9*2~kVib`2~T;(b6)V0 zSG?v8Z+XXiKJbxGeC7*Z`NnsC@RMKs<`4hp4@6*s5R_m9Cj=o0MQFkhmT-h80uhNs zWTFt2XhbIlF^NTN;t-d3#3um>Nkn3jkd$O3=Py!_l2oK74QWY7dNPoaOk^etS;@0trU*qTMsZ3|l2VkW3}q=tdH&`fDo~M1RHh15sYZ2bP?K8J zrVe$fM|~R5kVZ772~BB6b6U`nRY(34*DrVoATM}Gz| zkUq#cl3zmwVjj0S|e^W1jGoXFTTxFL}jl-td-pyypWS U`NU_w@Re_T=LbLe#c%%bACCI~5C8xG literal 0 HcmV?d00001 diff --git a/TP2/part_3/out b/TP2/part_3/out new file mode 100644 index 0000000..ad9658d --- /dev/null +++ b/TP2/part_3/out @@ -0,0 +1 @@ +list: [9] 0, 9, 18, 27, 36, 45, 54, 63, 72 \ No newline at end of file diff --git a/TP2/part_3/serialization b/TP2/part_3/serialization new file mode 100755 index 0000000000000000000000000000000000000000..932c8e25db6ee8b87245e761cbf21f0b434201b8 GIT binary patch literal 15992 zcmeHOeQ;b=6~DV_A%*6nkVQoukXCi1$VT2Js!bQCaw`=jaMrqpgU$a=>}9lY!MaM zUoI{a=fPeeG1VVX3cX5BdW&_r#>=3IS4)i&`ojtqtT{r`#G6n0^aQMhJ`Un7B$BqB z`V~DWYwow^^AQ>1lY2|okOPFZokzJDuan(kyt!B((s_AEYvz$jya~;l&^$})`6jgH zd{X$dZPEF3>Hzvk0&*{elQ*DwPQ6Y0v!*#nZg@Q#`FG~))Vx(bIgD`XMgJsr}|3KZqmQ8h=8vU7+e}fEx;;P3+ z*VOi1-NHL4MhIiRM|g^CueRYLg?wwUQQC>$eAzp{99S2=c~MQeNmOrsp!>S-Hj)n= z2aQQSB!tn%LVdh3_CfSTaH7pAs{oY39|P`lI>WvOTPgqOJUGQ#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W)&YdDpR(p`#!sVz zt{tAA*Voo}t8{P>y8cO+$LDbd7`ZT?zrPw;Pu@bTQOepgpY^-wvGe(Pa8mPoET(EO zkF^(MJD=CBo%PC}_Y2h!nC{9#eCc6*0PWJcFotG zMMmQxJ)ofjqx&$OCys~jAM~8dv7>3p#75QhItJ%?*^!pRrTDKkDUT012o6*H6U;-J AJ^%m! literal 0 HcmV?d00001 diff --git a/TP2/part_3/serialization.c b/TP2/part_3/serialization.c new file mode 100644 index 0000000..fa139d3 --- /dev/null +++ b/TP2/part_3/serialization.c @@ -0,0 +1,56 @@ +#include +#include + +#define INT_N 9 + +void write_list_to_stream(int * list, int size); +int * read_list_from_stream(); + +int main(int argc, char *argv[]) +{ + int * l = malloc(sizeof(int) * INT_N); + for (int i = 0; i6~41c8mDQz&cm&nw9No@NvXV9KN2}j(yS9tGOm*5(U>aGFxhy=_9A=N z?1MU06C##WTDhqTLbQndXaxu)got=Fr9iZ)tGEgL*wPLX2Ft2NRn{ZEen;0rJ4uf7LZHn zUimZCC`)n7?T z=97j`N2lV`D_6#mkHUp@*^KbY4#zB5a({b) zBVKN_@MYeo`n%qB2rK?sDq6+bq4?qT9czbTEkp4{cC=-*bA8MDj!-%oYLi2tafNZv zn%ePDuLv9$1+p<-6WSa-pmc=DLa{4w5bcEj>Z$e<-!xl45k2_PW#9YNy5)Bm&n}}F zng_K>F;vJ#2N&}3!L}QbcOqz6jldDu^cr^RqgMO_*RekZyN<(KZiS&%J70rc_Xa~> zi{ryJ?6iJswIkA*)R3JJmerRzGGbeYt)XO}7>*8+uq<5FJ}aGxrZU!WG%mwNqgH=B z5gm#@Zi|srJdx=a6h)VMz1Xp{XX`erE!1AEwT0GI>+K!F>e;``irFc9AfC?Hsr|dQ z4J8xy{^;Q$8{G{ICljhW%L%O+h`C^WU@gp(XR7fvrn&(?ujl3Q_!3$HyOk}wGQNmb z(E+9Z@QYu;$0Q(Z=v4T=!=Lvp~^y6k+5CRfR2=e{K*BF}Rfi_iX06ty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wQqDklxml4%b9Lq$#cyPI6m){|vI)n4?NVht7jWByYUII4Aa`auWOfKnce$@ zwPWY*tzA2<-P^Z6Z0xu8cWvEiAm`hgaUQ8=lz(vUIKF(d&@s;aspK$n$Wy|yW6?}h zP_}wprMXvIqpWl%d3}z_vIyd2p#Mucx)n<&t-)v_MycvOyAc(OC#-DRj;Vb4xlP%L z7@9boPOIir{yZ|?E#skX>x1&!X);5|k9W<*>T~7Y&+Q1)%b+J${(jZpE<`AOWH=K& z44Fwea*%82#!iihP$HSJLj#FyXe5;!u~V5NF4N&`9KY#^$CRmSYfnoiIv`~DU^G1_ zLa`$Wbm2&_EK_(M{y(qWGM4KkKZ1k)w=%v{;aNuDa~J-<%eM8XxbdS3&yv0mb{D=+v8@Lc zH~y5uv(!0INiY5p*x$qdY92rDUs&?|`8NgL@kfEDy$j=cf5Wn@`lT@v&y44NMjSR8 zGUIu_#FF<%2$6-_aF@?Op}h#>dH=zZ_eDH@j$?TYc-q^r&ifmd5!IP@{K_m&qC%W9 zp7&QQ3o4NN_s;)Wh2N^;c)!N-kPADResBZ=ig7V+~QeqjOS**>%sH>fFXOy1-vhni=|8CD4&pONB z0TXoL`T1nBg<89|UL5V3&iG4k(ArVAjq3ig`a4XT915*}DvaanI0GAnFrI%eRai^W zLacE_^~`vd@5AH9^YhJ=!gp4YPK9wS0|2}6dc=v-!;a)}I@-1IS9O4?EgnDbzrqU7 z{ct?>etXNjd30OxKCW!}rfcu<_X4cpX~?D)g?= UT|6rGz_szG)xy8k1MsNgpLAR@^8f$< literal 0 HcmV?d00001 diff --git a/TP3/decoupage.c b/TP3/decoupage.c new file mode 100644 index 0000000..29def33 --- /dev/null +++ b/TP3/decoupage.c @@ -0,0 +1,83 @@ +#include +#include +#include +#include + +int * int_list_from_str(char * str); +int int_count_from_str(char * str); + +int main(int argc, char *argv[]) { + if (argc != 2) { + printf("Usage: %s \n", argv[0]); + return -1; + } + + printf("%d ints\n", int_count_from_str(argv[1])); + /*int * list = int_list_from_str(argv[1]); + for (int i=0; i 0) { + current_i *= -1; + } else { + return 0; + } + } + return list; +} + +int int_count_from_str(char * str) { + int ic = 0; + int current_i = 0; + int is_i = 1; + + int len = strlen(str); + for (int i = 0; i < len; i++) { + printf("str[%d]: %c\n", i, str[i]); + if (str[i] == ' ') { + if ((i+1 < len && str[i+1] != ' ') || (i+1)==len) ic++; + is_i = 0; + current_i = 0; + } else if (isdigit(str[i])) { + if (is_i) { + current_i *= 10; + } else { + is_i = 1; + } + current_i += (str[i] - '0'); + } else if (str[i]=='-' && current_i > 0) { + current_i *= -1; + } else { + return 0; + } + } + return ic; +} diff --git a/TP3/stringprinter b/TP3/stringprinter new file mode 100755 index 0000000000000000000000000000000000000000..9bcd58a29843dfa6bb38939153d5a8082f6f2728 GIT binary patch literal 15704 zcmeHOYit}>6~4QU8>gus33clv5Dz6m3CNpu;#h7|C+o*LW5}zi%|n6?YkO?3uy@Vw zxN)kc7`dssGLeEri-h_E_=AL?M1UaTA?zCEB?K-=Rj5E%Rf_B;lvD(8ikjs+ch1?& z4r{0?gan#v&7OO{bH4jHb7$sy=j>3_cb}b?m&x3g7WMbVf zpW$(e6nmjRgUBd`{w&BVtcvvVC^qvAuETt5u^i+6CRhrORN^f#Z-IFQNdqD~ONl4N zgpL-Dr(eckqY~4fO8I#c%=61m_7_QgP1xhJVZJEA~~#T$4IiTxoOA9K*LBfH9pZW(bC+|+!V>CBRlmFXk1Yow5IkS z>Q&)MHA9&2Ln>6HhgpY5S7mvBr1GfLo1z)Jb=Spjcf0Y3@cz~L`6hf?i-5xC)ZhQ1ZY zeI@WJV5Qoj+d?T^4W`HJlp4>D*!GypBvJ#)vT*MEt*n#CIM!$)nF7*3k+24nsl-U~ zF_LVZ`0vbuW?S_5{*9!h2% zJJWNpVI#aXb*h6lfseMxNd;A=g2 zPz@pwL?DPj5P={9K?H&b{I5jd&()jXG^egrnA7F6JCrg{&N$)xygBu=ia9-n{O(JD z^ILz8&+7UZYNQX7ZD}Eovh@Yh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b4}0qbyA*TeB1tEa8~Kpg4a{`~To zq>TT&G;w<%;UqZyyg;HnbIMImazc8MK_{mdA(lmrxVh&4lz46pWYg9#lHe&Rz56h{ z29hajJZmE>-qxw{ec3E?b!NQIp7*tn)OIU=sMGpaiR{H0^~DWfDvr*?FM{0+{US(3 zvd2fAL?5J+apkbokeY92##AJgcI?PdYCJNQ!MB$g=eP&z8&Bf*9mxTP+Sl@)(w`n3wNp-swf{~a zdhX*Az_-J0spAKjNO|tFS^G+zxeG<9g*@3_m5u& za0(TQsqkgLC31!xrGNkYzr_4@_LKda$kQG^?eYBluL7f(Nc)BRKHvXkU(3ztu}YmJ zJ%7D?gLxvyyw0ezxgfvpGT$sP-HPx;hC%l7WnUPLy8bdwX-0Sj9c02}{IQs8 zi80^rPknhyCHK$n1(WdU{_ZWp_exoNUcU)$@GKkYK1}CH#v}K&HNa%-UVe0!t9@QN XVxv#R9=J6B$MjMXcJd*3m{e literal 0 HcmV?d00001 diff --git a/TP3/stringprinter.c b/TP3/stringprinter.c new file mode 100644 index 0000000..f61e5e0 --- /dev/null +++ b/TP3/stringprinter.c @@ -0,0 +1,31 @@ +#include +#include +#include +#include + +int main(int argc, char *argv[]) +{ + if (argc!=3) { + printf("Usage: %s ", argv[0]); + return -1; + } + + FILE * f = fopen(argv[1], "w+"); + if (f==NULL) { + printf("Error while opening file %s\n", argv[1]); + return -2; + } + + for (int i = 0; i<2000; i++) { + fprintf(f, "%s", argv[2]); + usleep(rand()%100); + } + + + fclose(f); + return 0; +} + +/* +* Si programme executé plusieurs fois sur le même fichier simultanément, deuxième programme lancé prend le pas après un court temps +*/ diff --git a/TP3/test b/TP3/test new file mode 100644 index 0000000..4f79322 --- /dev/null +++ b/TP3/test @@ -0,0 +1 @@ +UwUUwUUwUUwUUwUUwUUwUUwUUwUUwUUwUUwUUwUUwUUwUUwUUwUUwUUwUUwUUwUUwUUwUUwUUwUUwUUwUUwUUwUUwUUwUUwUUwUUwUUwUUwUUwUUwUUwUUwUU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hmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmmhmmmmmm \ No newline at end of file diff --git a/TP4/ex_4 b/TP4/ex_4 new file mode 100755 index 0000000000000000000000000000000000000000..5033095d58db51f1f458ca415f8d91fe8209f1f9 GIT binary patch literal 15696 zcmeHOU2GiH6~4Pkh$%_z(1e)ZOesO3tv7b!L--R6T1wN&#=DNU*t_oj zP=^v~)dXp4QiX^9sER7_1P?`2Di0Awun-i7hzh4g$WoDNRYqNxzfjzEY28e}bLX7# zc-R1KANn#!n)&WM=X~ehIrr}Dot?YiGrKyXk%$smpl(xCJJ{fA;%pe-$OS-LZB|Qh zzCm5DE<=5x*17h$3$VH}5uJ~9tX}{mULzH1;B~HA2}%zMiFYYEOC5p;D!vZlEg}Qg zgZLW`DkyfZJ%h*)L!Ui-gd8A(ejasYyh)qY__q1@HO|XHM&VJFc$3VVWS)oI-Xx>s zle$mGX3l32P}9)nO--9xWBF`sy>6KL)r^DY z)Xv@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SW8m0Ih9cNV_jhp_nh@|;s)ezV7P3&InOg6!wZda#j+(oYE^ zJg*Ki>7@U%j#|t7pg*U4p?C$-G^zMq(5^1q~|y3 eyPt1uaBDefh>d}&er&GAf2P$XTooV$s_NhD&OAH- literal 0 HcmV?d00001 diff --git a/TP4/ex_4.c b/TP4/ex_4.c new file mode 100644 index 0000000..87f397d --- /dev/null +++ b/TP4/ex_4.c @@ -0,0 +1,74 @@ + +#include +int less(int a, int b); +int more(int a, int b); +int pair_more(int a, int b); + +void sort(int * tab, int size_tab, int (* sort_func)(int, int)); + +void print_tab(int * tab, int size) { + printf("tab[%d] = [", size); + for (int i=0; i b) { + return 1; + } else { + return -1; + } +} + +int pair_more(int a, int b) { + if (a%2==0) { + if (b%2!=0) { + return 1; + } else { + return more(a, b); + } + } + return -1; +} + +void sort(int * tab, int size_tab, int (* sort_func)(int, int)) { + int i,j, tmp; + for (i=0; i6~4QUn>DQ;iQ?2rNIVJ+IBmVL9mjHsOxBNe#?(&I!~u$c@!C7~u4=E{ z-7$3vDXt79i;2_-iDxCm4+MXZB2gg=5ZPdqM*-o`3Pt^c1r#}I3R_`N3YC}d%$&0x zPwf^V#E)u@HS^u``0l-PW_IT8&hh7>z1_h;K#7#74=K_HsvJv%9f?ES07O))D#w10 z+O6(_zR9*Z{)hwcI&w3(7DH?=0TQo<8tdSD9kUXY84?n2BUzvcK?D^a2k}bD!MYdA zc%FjdFOH`X8KT+yBEH0`pqoci$<;dnxwf^K;PECHg-0s!7MQodJi$Co2qGx?q@2*! z%K7wS1U{08y;sW1n_`|9yEtBu#vnQMiWUEF#yi2hkY;zIy!fDFR)R9#BjE9=<%qWj zIn5_|yp7I7g!3=R=~V|tlY=eI2S(%dqsi3dRQ*(IOMOdoI5Qq@vInMlHDIG_>gci4 zDmbljWD|Zs1=i?6))8V0#csn!X(#?~qQ7n3y#3<0cii}M^x>EH=H?!L`gasV$3cBk z3<=q26Cs~$V*5|LNmsHqHNWNbWTWUN@)G7KklgFwU#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x@JMPhJdqxsFw@ot z$Mb13ox#anqZsg|&CwVUxHU0qsjxlGuw_o6ZRbCn9=Fd%*i0D1>DZWQB;w$T<}i#{ zIvvAAi6L!t92-jxVbpQ-gRpFuWu`x4+to#pzp2N7bi#7Q*{6GGxf?$o)iYJ!rW3&oN(6lR!oGyvgIz94U9gmvulAHkz{VWj!M(>lcLB;?4i# zu+myV__96_lxKjy}>mR`!2g>-~|c|iRlMuxcTxN7o_!xTfEor58))fqV%_#X|>syZhCvdp=A>lDTC`3l@ z__SVe^IMrGNcnY(cRnw|iDEp=NGN%?m;ZCh9iV8X>KrKUg)jI9JZ`>x|5##v zLy_q;geMpT+0B>rTMZLsp3;r*iaN+-lljX!sgC*HcpA$s y3LM}L&#{y4!*rfxK63vogH7h{qN}AQM;n%b*y&O2uea;*k2O1l?H+ + +typedef union int_test { + int a; + char b[4]; +} test; + +void print_hex(int n); + +int main(int argc, char *argv[]) +{ + /*test i = {.a=429496729}; + for(int j=0; j<4; j++){ + printf("%d ", i.b[j]); + } + printf("\n");*/ + + print_hex(14*256 + 11*16 + 8); + print_hex(4*256 + 2*16 + 0); + return 0; +} + +void print_hex(int n) { + test i = {.a=n}; + for (int j=0; j<4; j++) { + printf("%d ", i.b[j]); + } + printf("\n"); +} diff --git a/TP4/union_ex3 b/TP4/union_ex3 new file mode 100755 index 0000000000000000000000000000000000000000..6734952af8f8a4e4cf563c0dc0e1a99c512b07bf GIT binary patch literal 15480 zcmeHOYit}>6~4PknoV0j64lK%q0Oi?&{TM`YdglFa-4*50wbVDGxS zW7t$ct%jnS5LEt9T2&PhLIfcsB>E!~Ke~}oNDxS_;78OywGfqDo~|e;g($;!?wm6j zk2VES2?;bun)&WM=Y03xId>j+cg{RHG&-D2B$UVo^^l@kuGQD%*l@Lr3xJ&JQBBz2 zqwZF>puSP-e0$CZSbe#YT#qT%ZvYZ6O@#*dK3}Z_WrT#pyP5RRfFOd3kArxd$iVd| zKF=KpiaqGhATq?z`v8Bjm3Yg{TV|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VVWlykK7lwKqq4l e^UrnowGT^2Y>ZT~_H4|5z0)Vq`YtSys`@9Uc7_lD literal 0 HcmV?d00001 diff --git a/TP4/union_ex3.c b/TP4/union_ex3.c new file mode 100644 index 0000000..dbf71e6 --- /dev/null +++ b/TP4/union_ex3.c @@ -0,0 +1,15 @@ +#include +#include + +void print_hex(int n); + +int main(int argc, char *argv[]) +{ + print_hex(14*256 + 11*16 + 8); //0xeb8 + print_hex(4*256 + 2*16 + 0); //0x420 + return 0; +} + +void print_hex(int n) { + printf("%x\n", n); +}