PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.c > question
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
question

Réponse
 
LinkBack Outils de la discussion
Vieux 24/11/2007, 09h09   #1
dattts@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut question

hi i have a doubt. consider i as a intiger variable. then what is the
meaning of statement i+=1;
  Réponse avec citation
Vieux 24/11/2007, 09h17   #2
Richard Heathfield
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: question

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
  Réponse avec citation
Vieux 24/11/2007, 09h23   #3
dattts@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: question

THANK YOU FOR YOUR SUJJESTION SIR
  Réponse avec citation
Vieux 24/11/2007, 09h45   #4
santosh
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: question

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.

  Réponse avec citation
Vieux 25/11/2007, 08h20   #5
RoS
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: question

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.

  Réponse avec citation
Vieux 25/11/2007, 08h33   #6
santosh
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: question

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>

  Réponse avec citation
Vieux 25/11/2007, 15h52   #7
oNKoNec
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: question

You should feel ashamed for asking so simple question!
  Réponse avec citation
Vieux 25/11/2007, 16h30   #8
CBFalconer
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: question

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

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 13h59.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,19950 seconds with 16 queries