Article View: comp.os.msdos.programmer
Article #3053TC++ Bug ?? or am I doing something wrong?
From: Ajai Sehgal
Date: Thu, 15 Nov 1990 14:41
Date: Thu, 15 Nov 1990 14:41
41 lines
1447 bytes
1447 bytes
I have the following variable declared in a function:
static int mstore;
The function prototype is as follows:
void rfft(float *x, COMPLEX *y, int m)
note:COMPLEX is a structure with real and imag floats
Here's the problem:
After the first call to the function the statement mstore = m; is
executed. On the second call to the function I want to skip a section of
code if m still equals mstore, so I have the following:
if (m != mstore){
.....bunch of statements to initialize coefficients
}
Unfortunatly the "bunch of statements" are always executed ( I stepped through).
Putting a watch on m,mstore and m!=mstore I see the following:
m : 7
mstore: 7
m != mstore: 0
but if I insert the statement n = (m != mstore); and put a watch on n I get:
n : 1
What's going on here? If I compile using C instead of C++ everything works fine.Could this have something to do with using smart virtual tables under C++ ?
Any insight would be appreciated.
Regards, Ajai.
but if I insert the statement
Technical Details
Message-ID:
<ajai.658680108@rigel.sce.carleton.ca>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!cunews!ajaiShow Full Headers
Complete Article Headers
Newsgroups: comp.os.msdos.programmer Path: arc1-ca.pugleaf.net!utzoo!utgpu!cunews!ajai From: ajai@sce.carleton.ca (Ajai Sehgal) Subject: TC++ Bug ?? or am I doing something wrong? Message-ID: <ajai.658680108@rigel.sce.carleton.ca> Summary: Help IF (m != mstore) doesn't work under c++ Sender: news@ccs.carleton.ca (news) Organization: Carleton University, Ottawa, Canada Date: 15 Nov 90 14:41:48 GMT