Pointeur de structure en C

Noha819 Messages postés 109 Statut Membre -  
ghuysmans99 Messages postés 2496 Date d'inscription   Statut Contributeur Dernière intervention   -
Bonjour,

Jai un gros problème avec un pointeur de structure en C!!!

voila ma structure située dans le main.cpp

struct global
{
HWND hwnd;

SDL_Surface* ecran;

SDL_Rect positionFenetre;

int ScreenX, ScreenY, FenX, FenY;
}global;

Je souhaite envoyer un pointeur de cette structure a parametres.cpp a la fonction

BOOL mainparametres(struct global *global)
{

initialisationparam();

SDL_Flip(global->ecran);

}
Que j'appelle comme ceci

mainparametres(&global);

Mais lors de la compilation codeblocks me dis "undefined type 'struct global'

Je deviens fou!!! SOS



Beh teh

2 réponses

  1. ghuysmans99 Messages postés 2496 Date d'inscription   Statut Contributeur Dernière intervention   342
     
    typedef struct _SGlobal
    {
    	HWND hwnd;
    	SDL_Surface* ecran;
    	SDL_Rect positionFenetre;
    	int ScreenX, ScreenY, FenX, FenY;
    } SGlobal;
    
    BOOL mainparametres(SGlobal *global)
    {
    	initialisationparam();
    	SDL_Flip(global->ecran);
    }
    0
  2. Noha819 Messages postés 109 Statut Membre 14
     
    Sa marche paaaas!
    0
    1. ghuysmans99 Messages postés 2496 Date d'inscription   Statut Contributeur Dernière intervention   342
       
      Réponse inutile si tu décris pas l'erreur ...
      0