C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

float, double et.. plantage

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ (French)
View previous topic :: View next topic  
Author Message
JM
Guest





PostPosted: Sat Oct 14, 2006 4:10 am    Post subject: float, double et.. plantage Reply with quote



Bonsoir

Voila mo problème.

J'ai la classe suivante :

class CLigneList
{public:

CLigneList();

CString Text;
float Valeur;
COLORREF CouleurTxt;
int Bitmap;
};

CLigneList::CLigneList()
{ Valeur=0;
Text="";
};

Quelque part, je crée une variable de ce type.

Sur un pc particulier, celaplante.
Je transforme le float en double et cela marche.

Je ne comprends pas pourquoi.
Back to top
Fabien LE LEZ
Guest





PostPosted: Sat Oct 14, 2006 4:23 am    Post subject: Re: float, double et.. plantage Reply with quote



On Sat, 14 Oct 2006 01:10:26 +0200, JM <nospamjm (AT) yahoo (DOT) com>:

Quote:
CLigneList::CLigneList()
{ Valeur=0;
Text="";

On conseille généralement d'écrire

CLigneList::CLigneList()
: Valeur (0)
, Text ("")
{}

Quote:
Sur un pc particulier, celaplante.

Ce code est correct ; le plantage vient d'ailleurs.

Probablement un code incorrect quelque part (utilisation de mémoire
libérée, par exemple), dont les conséquences sont par définition
aléatoires, et peuvent donc varier quand tu modifies du code qui n'a
rien à voir.
Back to top
JM
Guest





PostPosted: Sat Oct 14, 2006 7:19 pm    Post subject: Re: float, double et.. plantage Reply with quote



Fabien LE LEZ a écrit :

Quote:
Ce code est correct ; le plantage vient d'ailleurs.

Probablement un code incorrect quelque part (utilisation de mémoire
libérée, par exemple), dont les conséquences sont par définition
aléatoires, et peuvent donc varier quand tu modifies du code qui n'a
rien à voir.

A priori, je compilais avec les options "SSE".
Le pc qui plante est pourtant un AMD Mobile 1400+, curieux
Back to top
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ (French) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.