Ce morceau de code plante juste apres le MessageBox, pourtant le compilo ne detecte aucune erreur.
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 void GetPoints( FloatPoint *FirstPoint, FloatPoint **Points ) { unsigned int i = 0, j = 0, NbOfStatesActivated = 0; for( i = 0; i < PixelPerColumns; i++ ) { for( j = 0; j < PixelPerLines; j++ ) { if( PixelStateCompared[ i * PixelPerLines + j ] == 1 ) { if( NbOfStatesActivated == 0 ) { FirstPoint->x = (double) j; FirstPoint->y = (double) i; } else { MessageBox(0, "plante ici","programme",0); Points[ NbOfStatesActivated - 1 ]->x = (double) j; Points[ NbOfStatesActivated - 1 ]->y = (double) i; } NbOfStatesActivated++; } } } } void GetStates( void ) { FloatPoint FirstPoint, *Points; Points = ( FloatPoint* ) malloc( sizeof( FloatPoint ) * ( NbOfPixelActivated - 1 ) ); GetPoints( &FirstPoint, &Points ); }
Je debute avec les pointeurs, est-ce quelqu'un pourrait me dire d'ou l'erreur vient?
merci d'avance pour vos reponses
Partager