Project

General

Profile

Actions

Bug #871

closed

Erreur dans fonction floatToChar

Added by Veronique bouzid almost 8 years ago. Updated almost 8 years ago.

Status:
Closed
Priority:
Normal
Category:
-
Target version:
-
Start date:
30/12/2016
Due date:
% Done:

0%

Estimated time:
revision:
r0

Description

hello

void floatToChar( float value, unsigned char* ptr) {
unsigned char* valuePtr;

valuePtr = (unsigned char*) &value;
ptr[0] = valuePtr[0];
ptr[1] = valuePtr[0];
ptr[2] = valuePtr[0];
ptr[3] = valuePtr[0];
}

---> il y a une erreur dans cette fonction, tu recopies la meme valeur valuePtr0 dans les 4 octets destintataires.
Il faut mettre
ptr1 = valuePtr1;
ptr2 = valuePtr2;
ptr3 = valuePtr3;

Actions

Also available in: Atom PDF