Skip to content

Instantly share code, notes, and snippets.

@pasberth
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pasberth/1cbe554d7db31b324edb to your computer and use it in GitHub Desktop.
Save pasberth/1cbe554d7db31b324edb to your computer and use it in GitHub Desktop.

ストラウストラップのプログラミング入門で登場する、

#include "std_lib_facilities.h"

という行は、すべて、次のプログラムに置き換えて 考えてください。

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
using namespace std;
inline void keep_window_open() { char ch; cin >> ch; }

hello_world.cpp に例を載せます。 これは、 ストラウストラップのプログラミング入門の p26 にある hello world です。

このプログラムを、コピペして、 helloworld.cpp というファイルに 保存したあと、ターミナルから、

g++ helloworld.cpp

と入力することでプログラムをコンパイルできます。

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
using namespace std;
inline void keep_window_open() { char ch; cin >> ch; }
int main()
{
cout << "Hello, World\n";
return 0;
}
#include "std_lib_facilities.h"
int main()
{
cout << "Hello, World\n";
return 0;
}
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
using namespace std;
inline void keep_window_open() { char ch; cin >> ch; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment