Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
2601 connectés 

 


 Mot :   Pseudo :  
 
 Page :   1  2
Page Suivante
Auteur Sujet :

comment ecrire "i=i-1" en C++?

n°1248403
masklinn
í dag viðrar vel til loftárása
Posté le 18-11-2005 à 14:33:42  profilanswer
 

Reprise du message précédent :
Probablement oui :o


---------------
I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box by throwing away the limits imposed by overbearing genetic regulations? Isn't that a good thing?
mood
Publicité
Posté le 18-11-2005 à 14:33:42  profilanswer
 

n°1248408
bjone
Insert booze to continue
Posté le 18-11-2005 à 14:40:28  profilanswer
 

hihi c'est exa...
 
de mémoire sur vc6 avec ça:
 

Code :
  1. for( int i...
  2. for( int i...


 
il te jettes une redéclaration le deuxième int i.
et sur 7.1, en mode compatiblité il te laisse le premier i visible hors scope for, mais ne gueule plus sur le deuxième 'int i' qui deviens le nouveau i du scope.
 
j'avais jamais fait attention, je croyais que j'étais en mode standard et que le i mourrait a la sortie du scope :D (j'ai toujours codé de manière a jamais avoir ce VC6-sisme, donc je croyais être en mode compliant-only)
 
autant pour moi...


Message édité par bjone le 18-11-2005 à 14:41:18
n°1249150
KangOl
Profil : pointeur
Posté le 19-11-2005 à 23:33:57  profilanswer
 

cultissime...


---------------
Nos estans firs di nosse pitite patreye...
n°1249159
masklinn
í dag viðrar vel til loftárása
Posté le 20-11-2005 à 00:08:27  profilanswer
 

KangOl a écrit :

cultissime...


pas spécialement, tu fréquentes pas assez The Daily WTF si ça t'impressionne encore :o
 
Me souviens d'un des posts de TDWTF, c'était du style

Citation :

  • You know how ++ will increment, right?
  • Right ....
  • Okay, so how do you increment by 11?

http://membres.lycos.fr/angel2k/petrus/petruseaf.gif


---------------
I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box by throwing away the limits imposed by overbearing genetic regulations? Isn't that a good thing?
n°1249187
KangOl
Profil : pointeur
Posté le 20-11-2005 à 01:38:39  profilanswer
 

masklinn a écrit :

pas spécialement, tu fréquentes pas assez The Daily WTF si ça t'impressionne encore :o
 
Me souviens d'un des posts de TDWTF, c'était du style

Citation :

  • You know how ++ will increment, right?
  • Right ....
  • Okay, so how do you increment by 11?

http://membres.lycos.fr/angel2k/petrus/petruseaf.gif


bha si justement... je crois qu'ont a de quoi rivaliser avec ses posts...


---------------
Nos estans firs di nosse pitite patreye...
n°1249189
masklinn
í dag viðrar vel til loftárása
Posté le 20-11-2005 à 01:47:03  profilanswer
 

Ouais enfin bon là on a affaire à un débutant, TDWTF c'est pas dédié aux débutants, c'est dédié au monde du travail :o
 
Sinon c'est trop facile :o


Message édité par masklinn le 20-11-2005 à 01:47:15

---------------
I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box by throwing away the limits imposed by overbearing genetic regulations? Isn't that a good thing?
n°1249190
KangOl
Profil : pointeur
Posté le 20-11-2005 à 01:48:07  profilanswer
 

c'est ca qui est pire...


---------------
Nos estans firs di nosse pitite patreye...
n°1251156
jesus_chri​st
votre nouveau dieu
Posté le 22-11-2005 à 23:44:00  profilanswer
 

pour Visual :
 

Code :
  1. #if (defined _MSC_VER) && (_MSC_VER < 1300)
  2. #define for if (0) {} else for
  3. #endif


 
et plus de pb sur VC 6.
Enlever le test "< 1300" et plus de problème du tout ;)

n°1251172
Ace17
Posté le 23-11-2005 à 00:01:24  profilanswer
 

jesus_christ a écrit :

pour Visual :
 

Code :
  1. #if (defined _MSC_VER) && (_MSC_VER < 1300)
  2. #define for if (0) {} else for
  3. #endif


 
et plus de pb sur VC 6.
Enlever le test "< 1300" et plus de problème du tout ;)


 
Encore plus for :
 

Code :
  1. #if (defined _MSC_VER) && (_MSC_VER < 1300)
  2. #define for if (true) for
  3. #endif


 

n°1251175
chrisbk
-
Posté le 23-11-2005 à 00:03:24  profilanswer
 

#define for  
#define sizeof(x) rand()
#define  if while


Message édité par chrisbk le 23-11-2005 à 00:09:23
mood
Publicité
Posté le 23-11-2005 à 00:03:24  profilanswer
 

n°1251195
the real m​oins moins
Posté le 23-11-2005 à 00:42:07  profilanswer
 

KNOCK KNOCK


---------------
Hey toi, tu veux acheter des minifigurines Lego, non ?
n°1251197
masklinn
í dag viðrar vel til loftárása
Posté le 23-11-2005 à 00:45:39  profilanswer
 

WHO'S THERE ???


---------------
I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box by throwing away the limits imposed by overbearing genetic regulations? Isn't that a good thing?
n°1251198
the real m​oins moins
Posté le 23-11-2005 à 00:46:44  profilanswer
 


LOL [:x-httpd-php]


---------------
Hey toi, tu veux acheter des minifigurines Lego, non ?
n°1341605
black_lord
Truth speaks from peacefulness
Posté le 07-04-2006 à 16:25:21  profilanswer
 

[:el g]


---------------
uptime is for lousy system administrators what Viagra is for impotent people - mes unixeries - github me
n°1341731
SBAM
Best recording of rach 3.
Posté le 07-04-2006 à 18:31:03  profilanswer
 

Je trouve pas de methode elegante pour gerer la decrementation sur des entiers negatifs  [:ktulu]  
Vous avez une idee ?
 

Code :
  1. #include <iostream>
  2. template <int curr, int end>
  3. struct SubDec
  4. {
  5.   static const int val = SubDec<curr + 1, end>::val;
  6. };
  7. template <int end>
  8. struct SubDec<end, end>
  9. {
  10.   static const int val = end - 1;
  11. };
  12. template <int i>
  13. struct Dec
  14. {
  15.   static const int val = SubDec<0, i>::val; //FIXME : nombre negatifs :/
  16. };
  17. int main ()
  18. {
  19.   std::cout << Dec<42>::val << std::endl;
  20.   return 0;
  21. }


 
 [:le profanateur]


Message édité par SBAM le 07-04-2006 à 18:32:52
mood
Publicité
Posté le   profilanswer
 

 Page :   1  2
Page Suivante

Aller à :
Ajouter une réponse
 

Sujets relatifs
Ecrire des guillemets dans un printEcrire un octet binaire dans un fichier
Coment écrire dans une case d'un tableau [Résolu ]ecrire dans la barre d'état (firefox)
[Dev-C++] Lire/Ecrire dans le registre[ksh] Ecrire dans STDERR sans redirection ?
ecrire sur un page via un formulaireécrire en japonais
avec VBS ecrire dans un fichier exel dans des champs a1 a2 ...[php] écrire du texte a l'écran em passant par un header
Plus de sujets relatifs à : comment ecrire "i=i-1" en C++?


Copyright © 1997-2025 Groupe LDLC (Signaler un contenu illicite / Données personnelles)