Wrox Programmer Forums
|
BOOK: Beginning Visual C# 2005
This is the forum to discuss the Wrox book Beginning Visual C# 2005 by Karli Watson, Christian Nagel, Jacob Hammer Pedersen, Jon D. Reid, Morgan Skinner, Eric White; ISBN: 9780764578472
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Visual C# 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 7th, 2010, 04:37 AM
Registered User
 
Join Date: Jan 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default A question about the post-++

I just begin to learn C#,and before that,i have learnded C++.
I want to konw How to achieve the operator post-++(in C#).
I know in C++ ,for exp:
int a = 0;
int b = a++;

is the same as:
int a = 0;
int temp = a;
a += 1;
int b = temp;

In C#,post-++ has a lower priority than operator =,so how would the post-++ work?( Sorry for my poor English:-) )

My suppose is:
int a = 0;
int b = a;
a +=1;
 
Old January 7th, 2010, 09:37 AM
Registered User
 
Join Date: Dec 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

if you want a value of 1 in a and a value of 0 in b then

in C# or C++

Code:
int a = 0;
int b = a++;
will both give the same results.
 
Old January 7th, 2010, 09:07 PM
Registered User
 
Join Date: Jan 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks,

I know they have a same result both in C++ and C#.

And it's just a example.
I want to know sth more detail:How the post-++ work in C#

Maybe i will know that after i read the chapter about function overload





Similar Threads
Thread Thread Starter Forum Replies Last Post
I was not sure where to post this iceman90289 C# 2005 1 March 26th, 2008 03:19 AM
Question on HTTP Post dgrumbli BOOK: Professional JavaScript for Web Developers ISBN: 978-0-7645-7908-0 3 December 20th, 2006 02:03 PM
Old post from a year ago, had question plz galacticsoul General .NET 0 August 4th, 2006 12:01 PM
vbscript question (not sure where to post this) interrupt Javascript How-To 0 February 14th, 2006 10:38 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.