|
|
 |
BOOK: Ivor Horton's Beginning Visual C++ 2008 ISBN: 978-0-470-22590-5
 | This is the forum to discuss the Wrox book Ivor Horton's Beginning Visual C++ 2008 by Ivor Horton; ISBN: 9780470225905 |
|
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: Ivor Horton's Beginning Visual C++ 2008 ISBN: 978-0-470-22590-5 section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
|
 |

January 6th, 2009, 07:59 AM
|
|
Authorized User
|
|
Join Date: Dec 2008
Posts: 10
Thanks: 2
Thanked 0 Times in 0 Posts
|
|
Comma Operator
At the page of 73 & 74 , I've read something about the comma operator . But I don't know in which case , this operator is used . Please help ! 
|

February 23rd, 2009, 06:19 PM
|
|
Registered User
|
|
Join Date: Feb 2009
Posts: 3
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Hi. The comma operator is used in declarations:
int a, c, d;
int e=4, f=5, g=6;
|
|
The Following User Says Thank You to ArtlessDodger For This Useful Post:
|
|

May 28th, 2009, 04:12 PM
|
|
Registered User
|
|
Join Date: May 2009
Posts: 5
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
Comma Operator
The comma operator is also used to seperate expressions. It appears frequently in the for statement. Example:
for (i = 0, j = strlen(s) - 1; i < j; i++, j--)
Ken
Last edited by KenStewart : May 28th, 2009 at 04:21 PM.
|
|
The Following User Says Thank You to KenStewart For This Useful Post:
|
|

May 29th, 2009, 12:40 PM
|
|
Authorized User
|
|
Join Date: Dec 2008
Posts: 10
Thanks: 2
Thanked 0 Times in 0 Posts
|
|
Thanks for your replies , I've known the functions of comma operator which you mentioned . But I mean , beside these functions , does comma operator have other special functions ?
|

June 10th, 2009, 11:56 PM
|
|
Registered User
|
|
Join Date: May 2009
Posts: 5
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
Comma Operator
phuc_tran,
While searching for something else, I stumbled across this tid-bit in an on-line book available from Microsoft MSDN called "C++ A Beginners Guide" by Herbert Schildt. It is something I would normally read right past without even noticing. However I remembered your question so I spent a little time looking at it. The following is copied directly from Chapter 7 page 31.
var = (count=19, incr=10, count+1);
"first assigns count the value 19, assigns incr the value 10, then adds 1 to count, and finally assigns var the value produced by the entire comma expression, which is 20."
I'm guessing the assignment of 20 to var is because this operation was the very last to be performed in the series of operations.
Ken
|
|
The Following User Says Thank You to KenStewart For This Useful Post:
|
|

June 12th, 2009, 04:45 PM
|
|
Registered User
|
|
Join Date: Jun 2009
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
|
|
YO!
What's ur real name...I can'rt talk to zombies...are u a professional...we can develop sth together..moreover, i do not belive that declarations use comma operators........ya..so coem out with real name...
|

June 12th, 2009, 04:46 PM
|
|
Registered User
|
|
Join Date: Jun 2009
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
|
|
Sorryy..the last one was a spam 
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |