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 

A Query

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++)
View previous topic :: View next topic  
Author Message
Naren
Guest





PostPosted: Fri Jan 30, 2004 11:50 am    Post subject: A Query Reply with quote



Hello Grp,

Why is this erroneous
if((uint32 ulStart = MInfo.ulGetNewDataStart()) ==
MInfo.ulGetNewVctrTableStart())
//do something

this works
uint32 ulStart;
if((ulStart = MInfo.ulGetNewDataStart()) == MInfo.ulGetNewVctrTableStart())
//do something

Thanks in advance.

Regards,
Naren.



Back to top
Sharad Kala
Guest





PostPosted: Fri Jan 30, 2004 12:09 pm    Post subject: Re: A Query Reply with quote




"Naren" <narendranath.ts (AT) in (DOT) bosch.com> wrote

Quote:
Hello Grp,

Why is this erroneous
if((uint32 ulStart = MInfo.ulGetNewDataStart()) ==
MInfo.ulGetNewVctrTableStart())
//do something

this works
uint32 ulStart;
if((ulStart = MInfo.ulGetNewDataStart()) == MInfo.ulGetNewVctrTableStart())
//do something

This is off-topic in this news-group.
Try out some newsgroup dedicated for your platform.



Back to top
Le Géant Vert
Guest





PostPosted: Fri Jan 30, 2004 1:45 pm    Post subject: Re: A Query Reply with quote



Sharad Kala wrote:

Quote:
"Naren" <narendranath.ts (AT) in (DOT) bosch.com> wrote in message
news:bvdgdi$mpk$1 (AT) ns2 (DOT) fe.internet.bosch.com...


Hello Grp,

Why is this erroneous
if((uint32 ulStart = MInfo.ulGetNewDataStart()) ==
MInfo.ulGetNewVctrTableStart())
//do something

this works
uint32 ulStart;
if((ulStart = MInfo.ulGetNewDataStart()) == MInfo.ulGetNewVctrTableStart())
//do something



This is off-topic in this news-group.
Try out some newsgroup dedicated for your platform.




off-topic ?? if you don't like the data types or the functions names,

just consider the following which is exactly the same :

not working :

if ((int i = function()) == value)
do something

working :

int i;
if ((i = function()) == value)
do something

the only difference is the variable declaration location... I don't know
exactly what the standard says, so others may have a more accurate
answer than the one I could give :)

Back to top
Phlip
Guest





PostPosted: Fri Jan 30, 2004 2:40 pm    Post subject: Re: A Query Reply with quote

Le Géant Vert wrote:

Quote:
off-topic ?? if you don't like the data types or the functions names,
just consider the following which is exactly the same :

not working :

if ((int i = function()) == value)
do something

working :

int i;
if ((i = function()) == value)
do something

the only difference is the variable declaration location... I don't know
exactly what the standard says, so others may have a more accurate
answer than the one I could give Smile

Sorry. Your post is off topic because you wrote "the" instead of "The" at
the beginning of that paragraph. And we won't get started about the Smile on
the end.

But the original poster is advised to report their error message to a
newsgroup that covers Standard C++ (such as this one).

C++ only recently gained the ability to cram a variable declaration inside
an expression, so some compilers might have a problem with it.

--
Phlip
http://www.xpsd.org/cgi-bin/wiki?TestFirstUserInterfaces



Back to top
Michael Mellor
Guest





PostPosted: Fri Jan 30, 2004 3:12 pm    Post subject: Re: A Query Reply with quote

Phlip wrote:
Quote:
Le Géant Vert wrote:
off-topic ?? if you don't like the data types or the functions names,
just consider the following which is exactly the same :

not working :

if ((int i = function()) == value)
do something

working :

int i;
if ((i = function()) == value)
do something

the only difference is the variable declaration location... I don't know
exactly what the standard says, so others may have a more accurate
answer than the one I could give :)


Sorry. Your post is off topic because you wrote "the" instead of "The" at
the beginning of that paragraph. And we won't get started about the Smile on
the end.

But the original poster is advised to report their error message to a
newsgroup that covers Standard C++ (such as this one).

C++ only recently gained the ability to cram a variable declaration inside
an expression, so some compilers might have a problem with it.


This is legal:
if ( int i = 1 ) {
}

what the OP is doing:
if ( (int i = 1) ) {
}
is not legal and if it was, what should the scope of 'i' be?

Michael Mellor

Back to top
Le Géant Vert
Guest





PostPosted: Fri Jan 30, 2004 7:07 pm    Post subject: Re: A Query Reply with quote

Phlip wrote:

Quote:
Sorry. Your post is off topic because you wrote "the" instead of "The" at
the beginning of that paragraph. And we won't get started about the Smile on
the end.


LOL

hum... is "lol" considered off-topic too ? ;)

Back to top
Rolf Magnus
Guest





PostPosted: Sat Jan 31, 2004 5:24 pm    Post subject: Re: A Query Reply with quote

Le Géant Vert wrote:

Quote:
Phlip wrote:

Sorry. Your post is off topic because you wrote "the" instead of "The"
at the beginning of that paragraph. And we won't get started about the
Smile on the end.


LOL
hum... is "lol" considered off-topic too ? Wink

No, but "LOL" is.


Back to top
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++) 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.