| View previous topic :: View next topic |
| Author |
Message |
Naren Guest
|
Posted: Fri Jan 30, 2004 11:50 am Post subject: A Query |
|
|
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
|
Posted: Fri Jan 30, 2004 12:09 pm Post subject: Re: A Query |
|
|
"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
|
Posted: Fri Jan 30, 2004 1:45 pm Post subject: Re: A Query |
|
|
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
|
Posted: Fri Jan 30, 2004 2:40 pm Post subject: Re: A Query |
|
|
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
|
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 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
|
Posted: Fri Jan 30, 2004 3:12 pm Post subject: Re: A Query |
|
|
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 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
|
Posted: Fri Jan 30, 2004 7:07 pm Post subject: Re: A Query |
|
|
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 on
the end.
LOL |
hum... is "lol" considered off-topic too ? ;)
|
|
| Back to top |
|
 |
Rolf Magnus Guest
|
Posted: Sat Jan 31, 2004 5:24 pm Post subject: Re: A Query |
|
|
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
on the end.
LOL
hum... is "lol" considered off-topic too ?
|
No, but "LOL" is.
|
|
| Back to top |
|
 |
|