|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
hi i have a doubt. consider i as a intiger variable. then what is the
meaning of statement i+=1; |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
dattts@gmail.com said:
> hi i have a doubt. consider i as a intiger variable. then what is the > meaning of statement i+=1; See K&R2, page 50, or Deitel & Deitel (5th edition), page 85, or Harbison & Steele (4th edition), page 223 - or if you have some other reference book, simply look up += in your C book's index. If you don't have a C reference book, get one - preferably one of the above, or "C Programming: A Modern Approach" by K N King (which I don't actually have, but apparently it's very good). -- Richard Heathfield <http://www.cpax.org.uk> Email: -http://www. +rjh@ Google users: <http://www.cpax.org.uk/prg/writings/googly.php> "Usenet is a strange place" - dmr 29 July 1999 |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
THANK YOU FOR YOUR SUJJESTION SIR
|
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
In article
<264c6ce2-a0f0-4c28-b927-9ea178c5f640@e23g2000prf.googlegroups.com>, dattts@gmail.com <dattts@gmail.com> wrote on Saturday 24 Nov 2007 2:39 pm: > hi i have a doubt. consider i as a intiger variable. then what is the > meaning of statement i+=1; This is functionally equivalent to the three statements below: i = i + 1; i++; ++i; Specifically, it is a shorthand notation for the first one. Others are: x /= y; (for x = x / y ![]() x -= y; (for x = x - y ![]() x *= y; (for x = x * y ![]() x %= y; (for x = x % y ![]() x >>= y; (for x = x >> y ![]() x <<= y; (for x = x << y ![]() x &= y; (for x = x & y ![]() x |= y; (for x = x | y ![]() x ^= y; (for x = x ^ y ![]() These shorthand operators are called as assignment operators. Look them up in your textbook or reference. |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
In data Sat, 24 Nov 2007 15:15:28 +0530, santosh scrisse:
>In article ><264c6ce2-a0f0-4c28-b927-9ea178c5f640@e23g2000prf.googlegroups.com>, >dattts@gmail.com <dattts@gmail.com> wrote on Saturday 24 Nov 2007 2:39 >pm: > >> hi i have a doubt. consider i as a intiger variable. then what is the >> meaning of statement i+=1; > >This is functionally equivalent to the three statements below: ^^^ to one of the three statements below > i = i + 1; > > i++; > > ++i; > >Specifically, it is a shorthand notation for the first one. Others are: > > x /= y; (for x = x / y ![]() > x -= y; (for x = x - y ![]() > x *= y; (for x = x * y ![]() > x %= y; (for x = x % y ![]() > x >>= y; (for x = x >> y ![]() > x <<= y; (for x = x << y ![]() > x &= y; (for x = x & y ![]() > x |= y; (for x = x | y ![]() > x ^= y; (for x = x ^ y ![]() yes they are very good >These shorthand operators are called as assignment operators. >Look them up in your textbook or reference. |
|
|
|
#6 |
|
Messages: n/a
Hébergeur: |
In article <8qaik3dglls1k6nuvnvj0jjma6ltjvo44h@4ax.com>, RoS
<Ros@not.exist> wrote on Sunday 25 Nov 2007 1:50 pm: > In data Sat, 24 Nov 2007 15:15:28 +0530, santosh scrisse: > >>In article >><264c6ce2-a0f0-4c28-b927-9ea178c5f640@e23g2000prf.googlegroups.com>, >>dattts@gmail.com <dattts@gmail.com> wrote on Saturday 24 Nov 2007 2:39 >>pm: >> >>> hi i have a doubt. consider i as a intiger variable. then what is >>> the meaning of statement i+=1; >> >>This is functionally equivalent to the three statements below: > ^^^ > > to one of the three statements below > >> i = i + 1; >> >> i++; >> >> ++i; Yes, you are right. I should have said "effectively" instead of "functionally", and qualified that it was only for the particular case presented by the OP. <snip> |
|
|
|
#7 |
|
Messages: n/a
Hébergeur: |
You should feel ashamed for asking so simple question!
|
|
|
|
#8 |
|
Messages: n/a
Hébergeur: |
oNKoNec wrote:
> > You should feel ashamed for asking so simple question! Meaningless. If you want to post a followup via groups.google.com, ensure you quote enough for the article to make sense. Google is only an interface to Usenet; it's not Usenet itself. Don't assume your readers can, or ever will, see any previous articles. More details at: <http://cfaj.freeshell.org/google/> -- Chuck F (cbfalconer at maineline dot net) <http://cbfalconer.home.att.net> Try the download section. -- Posted via a free Usenet account from http://www.teranews.com |
|
![]() |
| Outils de la discussion | |
|
|