Retourner au contenu associé (journal : Moi, expert C++, j'abandonne le C++)
Posté par calandoa le 04 juin 2019 à 13:11. En réponse au journal Moi, expert C++, j'abandonne le C++. Évalué à 1.
...mais plutôt qu'un long discours, 2 petits exemples:
#include <string> #include <stdio.h> int main() { std::string s("++123"); printf("%s\n", s.substr(2).c_str()); const char *c1 = s.substr(2).c_str(); printf("%s\n", c1); std::string s2 = s.substr(2); const char *c2 = s2.c_str(); printf("%s\n", c2); }
#include <iostream> struct A { A() { std::cout << "A" << std::endl; } }; struct B { int b; B() : b(0) { std::cout << "B" << std::endl; } B(int _b) : b(_b) { std::cout << "B " <<b << std::endl; } }; int b = 1; int main() { A(); B(b); }
Qu'écrivent ces programmes sur la sortie standard ?
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
# Je hais le C++
Posté par calandoa . En réponse au journal Moi, expert C++, j'abandonne le C++. Évalué à 1.
...mais plutôt qu'un long discours, 2 petits exemples:
Qu'écrivent ces programmes sur la sortie standard ?