[Resolved]: anyone know what does (x,y) do?

Write here if you have problems with your C++ source code

Moderator: Board moderators

Post Reply
bugzpodder
Experienced poster
Posts: 147
Joined: Fri Jun 13, 2003 10:46 pm

[Resolved]: anyone know what does (x,y) do?

Post by bugzpodder »

i came a few program that has a simple statement, something like:
(x,y);

whatever does that line do?
Last edited by bugzpodder on Mon Jul 28, 2003 4:53 pm, edited 1 time in total.
Julien Cornebise
Experienced poster
Posts: 145
Joined: Sat Feb 23, 2002 2:00 am
Location: Paris, France
Contact:

Post by Julien Cornebise »

Hi !

Could you please post an example here to help see the context ?
anupam
A great helper
Posts: 405
Joined: Wed Aug 28, 2002 6:45 pm
Contact:

Post by anupam »

may be a objct of a class initailization.
"Everything should be made simple, but not always simpler"
Viktoras Jucikas
New poster
Posts: 22
Joined: Sun Oct 20, 2002 6:41 pm
Location: Lithuania
Contact:

Post by Viktoras Jucikas »

This might shed some light on comma operators: http://tinyurl.com/hkym

And code example is:
[cpp]
char* x = (char*) -1;
if( x = 0, delete x++, (int)x )
{
// do something
}
[/cpp]
Now this is called 'readable' code...
anupam
A great helper
Posts: 405
Joined: Wed Aug 28, 2002 6:45 pm
Contact:

Post by anupam »

thanks for help but is it what he asked actually?
I am not sure. plz describe ...
"Everything should be made simple, but not always simpler"
bugzpodder
Experienced poster
Posts: 147
Joined: Fri Jun 13, 2003 10:46 pm

Post by bugzpodder »

yeah thanks, its probably something like that. i have never heard of a comma operator before, so its very itneresting
Post Reply

Return to “C++”