473,396 Members | 1,780 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Weird?

A
while compiling my code I get the following message:

matfunoperable.cpp: In member function ?virtual void
matfunoperable::qrdelete(gsl_matrix*, gsl_matrix*, size_t, char)?:
matfunoperable.cpp:32: warning: suggest parentheses around assignment
used as truth value
matfunoperable.cpp:35: warning: suggest parentheses around assignment
used as truth value

Code snippet that contains lines 32 and 35:

32 for (size_t iter = 0; iter = j-2; iter++){
33
gsl_vector_memcpy(&gsl_matrix_column(R_new,iter).v ector,&gsl_matrix_column(R,iter).vector);
34 }
35 for (size_t iter = j-1; iter = n-1; iter++){
36
gsl_vector_memcpy(&gsl_matrix_column(R_new,iter).v ector,&gsl_matrix_column(R,(iter+1)).vector);
37 }
prototype of the function (in the .h file) in which the above snippet
is contained is:

virtual void qrdelete(gsl_matrix *Q_new, gsl_matrix *R_new, const
size_t j, const char orient);
The executable is formed. However when I run the executable, none of
the instructions in main() are executed. Can anyone throw some light on
what is happening here?

Thanks,
A

May 23 '06 #1
4 1830
A wrote:
while compiling my code I get the following message:

matfunoperable.cpp: In member function ?virtual void
matfunoperable::qrdelete(gsl_matrix*, gsl_matrix*, size_t, char)?:
matfunoperable.cpp:32: warning: suggest parentheses around assignment
used as truth value
matfunoperable.cpp:35: warning: suggest parentheses around assignment
used as truth value

Code snippet that contains lines 32 and 35:

32 for (size_t iter = 0; iter = j-2; iter++){


Common bug which your compiler is kind enough to point out - you are
using assignment (=) rather than equality (==).
--
Ian Collins.
May 23 '06 #2

A wrote:
while compiling my code I get the following message:

matfunoperable.cpp: In member function ?virtual void
matfunoperable::qrdelete(gsl_matrix*, gsl_matrix*, size_t, char)?:
matfunoperable.cpp:32: warning: suggest parentheses around assignment
used as truth value
matfunoperable.cpp:35: warning: suggest parentheses around assignment
used as truth value

Code snippet that contains lines 32 and 35:

32 for (size_t iter = 0; iter = j-2; iter++){ The executable is formed. However when I run the executable, none of
the instructions in main() are executed. Can anyone throw some light on
what is happening here?


You're compiler is giving you a pretty good idea. Is it really your
intention to assign the value of j - 2 to iter and then test to make
sure the result is not 0?

What occurs is actually the best that could happen...other option is
infinite loop.

May 23 '06 #3
Ian Collins wrote:
A wrote:
while compiling my code I get the following message:

matfunoperable.cpp: In member function ?virtual void
matfunoperable::qrdelete(gsl_matrix*, gsl_matrix*, size_t, char)?:
matfunoperable.cpp:32: warning: suggest parentheses around assignment
used as truth value
matfunoperable.cpp:35: warning: suggest parentheses around assignment
used as truth value

Code snippet that contains lines 32 and 35:

32 for (size_t iter = 0; iter = j-2; iter++){

Common bug which your compiler is kind enough to point out - you are
using assignment (=) rather than equality (==).

Or whatever comparison operator you intended.

--
Ian Collins.
May 23 '06 #4
A
Thank you all. This was so unexpected.
A

May 24 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Gabriel Afana | last post by:
I have a simple php script to just send email.....When I first load the script in a browser...it sends 2 emails. Why?? The weird thing is then when I refresh the page, it send only one email...I...
3
by: redneck_kiwi | last post by:
Hi all: I have a really weird problem. I am developing a customer catalog system for my company and as such have delved into sessions for authentication and access levels. So far, I have managed...
13
by: Wolfgang Kaml | last post by:
Hello All, I have been researching newsgroups and knowledgebase all morning and not found a solution that would solve the problem I have. I am having an ASP or ASPX web page that implement a...
0
by: LRW | last post by:
I manage our mySQL database through putty (SSH terminal client). And whenever I do a select * from the table that contains ENCODEd passwords, the funky characters do funky things with the display....
2
by: jwbeaty | last post by:
Here's a weird one. I'm running SQL Server 7 and when I run a backup something weird happens. When I perform the backup via Enterprise Manager by right clicking on the database I want to...
1
by: Kaneda | last post by:
Hello everyone! I have some weird(?) problems, and I am not quite sure if there are due to my errors or maybe a limitation in the .Net framework. I have a ComboBox I need to fill with the...
0
by: Kaneda | last post by:
Hello everyone! I have some weird(?) problems, and I am not quite sure if there are due to my errors or maybe a limitation in the .Net framework. I have a ComboBox I need to fill with the...
82
by: nobody | last post by:
Howdy, Mike! mikecoxlinux@yahoo.com (Mike Cox) wrote in message news:<3d6111f1.0402271647.c20aea3@posting.google.com>... > I'm a C++ programmer, and have to use lisp because I want to use >...
3
by: aling | last post by:
Execute following T-SQL within Queary Analyzer of SQL Server 2000: ======================================= DECLARE @dTest DATETIME SET @dTest='2001-1-1 1:1:1:991' SELECT @dTest SET...
0
by: P Pulkkinen | last post by:
Dear all, sorry, i know this code is far little too long to debug here, but there is really annoying logical error. If someone debugs this, I really offer warm virtual handshake. What this...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.