p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 6th, 2009, 07:59 AM
Authorized User
Points: 85, Level: 1
Points: 85, Level: 1 Points: 85, Level: 1 Points: 85, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2008
Posts: 10
Thanks: 2
Thanked 0 Times in 0 Posts
Default 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 !
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old February 23rd, 2009, 06:19 PM
Registered User
Points: 11, Level: 1
Points: 11, Level: 1 Points: 11, Level: 1 Points: 11, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2009
Posts: 3
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi. The comma operator is used in declarations:

int a, c, d;
int e=4, f=5, g=6;
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
The Following User Says Thank You to ArtlessDodger For This Useful Post:
phuc_tran (May 28th, 2009)
  #3 (permalink)  
Old May 28th, 2009, 04:12 PM
Registered User
Points: 39, Level: 1
Points: 39, Level: 1 Points: 39, Level: 1 Points: 39, Level: 1
Activity: 6%
Activity: 6% Activity: 6% Activity: 6%
 
Join Date: May 2009
Posts: 5
Thanks: 0
Thanked 3 Times in 3 Posts
Default 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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
The Following User Says Thank You to KenStewart For This Useful Post:
phuc_tran (May 28th, 2009)
  #4 (permalink)  
Old May 29th, 2009, 12:40 PM
Authorized User
Points: 85, Level: 1
Points: 85, Level: 1 Points: 85, Level: 1 Points: 85, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2008
Posts: 10
Thanks: 2
Thanked 0 Times in 0 Posts
Default

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 ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #5 (permalink)  
Old June 10th, 2009, 11:56 PM
Registered User
Points: 39, Level: 1
Points: 39, Level: 1 Points: 39, Level: 1 Points: 39, Level: 1
Activity: 6%
Activity: 6% Activity: 6% Activity: 6%
 
Join Date: May 2009
Posts: 5
Thanks: 0
Thanked 3 Times in 3 Posts
Default 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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
The Following User Says Thank You to KenStewart For This Useful Post:
VC++ (June 12th, 2009)
  #6 (permalink)  
Old June 12th, 2009, 04:45 PM
Registered User
Points: 11, Level: 1
Points: 11, Level: 1 Points: 11, Level: 1 Points: 11, Level: 1
Activity: 9%
Activity: 9% Activity: 9% Activity: 9%
 
Join Date: Jun 2009
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Default 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...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #7 (permalink)  
Old June 12th, 2009, 04:46 PM
Registered User
Points: 11, Level: 1
Points: 11, Level: 1 Points: 11, Level: 1 Points: 11, Level: 1
Activity: 9%
Activity: 9% Activity: 9% Activity: 9%
 
Join Date: Jun 2009
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Sorryy..the last one was a spam
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
=== operator in c# surendraparashar C# 2005 8 November 8th, 2007 04:14 AM
Invalid operator for data type. Operator equals di Pusstiu SQL Server 2000 2 August 10th, 2007 04:51 AM
how to use like operator thillaiarasu SQL Server 2000 3 April 25th, 2007 08:53 AM
intersect operator kapy_kal XSLT 1 March 29th, 2006 01:02 PM
? operator in PHP Tachyon Beginning PHP 2 May 24th, 2004 02:59 PM



All times are GMT -4. The time now is 09:47 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc