Bonjour, je suis débutant en programmation et on m'a demandé d'effectuer un programme pour faire "voler" un avion en console en c, j'ai donc décidé d'utiliser une matrice seulement j'ai des petits problèmes au niveau des pointeurs je crois.
Pouvez vous m'aider ? voilà mon code :

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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#include "bibli est.h"
 
void init()
{
    int i;
    int j;
    int k;
    int l;
    x=25;
    y=50;
 
    int** matrice1[50][100];
 
    for(i=0; i<50; i++)
        for(j=0; j<100; j++)
        {
            matrice1[i][j]=0;
 
            int d=219;
            matrice1[x][y]=d;
 
            printf("%c", matrice1[i][j]);
        }
 
    int matrice2[1][100];
 
    for(k=0; k<1; k++)
        for(l=0; l<100; l++)
        {
            matrice2[k][l]=178;
            printf("%c",matrice2[k][l]);
        }
 
    Mvt(matrice1,i,j);
}
 
 
void Mvt(int** matrice1,int i,int j)
{
    int a=1;
 
    while (a=1)
    {
        if (GetKeyState(VK_LEFT))
        {
            MVTG(matrice1,i,j);
        }
        else if (GetKeyState(VK_RIGHT))
        {
            MVTD();
        }
        else if (GetKeyState(VK_UP))
        {
            MVTH();
        }
        else if (GetKeyState(VK_DOWN))
        {
            MVTB();
        }
    }
}
 
void MVTG(int** matrice1,int i,int j)
{
                matrice1[x][y]=0;
                int d=219;
                matrice1[x-1][y]=d;
                printf("%c", matrice1[i][j]);
}
 
 
avec la bibliothèque :
 
#ifndef BIBLI_H_INCLUDED
#define BIBLI_H_INCLUDED
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
 
void init();
void Mvt(int** matrice1,int i,int j);
void MVTG(int** matrice1,int i,int j);
 
int x;
int y;
 
#endif


Merci d'avance