Newsgroups: comp.os.msdos.programmer Path: utzoo!utgpu!cunews!ajai From: ajai@sce.carleton.ca (Ajai Sehgal) Subject: TC++ Bug ?? or am I doing something wrong? Message-ID: 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 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