Bonjour,
Bonjour,
J'essaye d'écrire une fonction qui retourne un tableau que je vais l'utiliser après, mais je n'y arrive pas.
Quelqu'un pourrait-il m'aider ?
Merci
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 #include <stdlib.h> #include<stdio.h> #include<math.h> int *tailleprob() { float nbl=0; float nbc=0; float L=10,l=10,dx=2,dy=2; float tableau[2]; nbl=(l/dy); nbc=(L/dx); tableau[1] = nbl; tableau[1] = nbc; return tableau; } int main() { int tailleprob(); int *t=tailleprob(); printf("%lf\n%lf\n",t[1],t[2]); return 0; }
Partager