Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- #include <stdlib.h>
- #include <time.h>
- #include <string.h>
- char invtab(char arr[])
- {
- arr[0] = arr[4];
- arr[1] = arr[3];
- arr[2] = arr[2];
- arr[3] = arr[1];
- arr[4] = arr[0];
- }
- char invpoint(char arr[])
- {
- int *q = &arr[0];
- q = 'n';
- int *p = &arr[1];
- p = 'a';
- int *z = &arr[2];
- z = 'm';
- int *o = &arr[3];
- o = 'a';
- int *u = &arr[4];
- u = 'm';
- return printf("Avec pointeurs : %c%c%c%c%c\n",q,p,z,o,u);
- }
- int main()
- {
- /*int x[5] = {1, 2, 4, 8, 16};
- int *p = &x[0];
- int *q = x;
- int *r =q;
- printf("%d %d %d %d %d %d\n",x[0],*p,x[1],*(p+1),x[2],*(p+2));*/
- char arr[]="maman";
- invtab(arr);
- printf("Avec tableau : %s\n",arr);
- invpoint(arr);
- }
- */Avec tableau : naman
- Avec pointeurs : namam
- 10:33:05: /home/mariomoser/C_learning_journey/build-pointeurs_1-Desktop-Debug/pointeurs_1 exited with code 0*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement