[memo]Windows 環境変数
Windowsで環境変数を変更した場合、ログインし直さないと有効にならない。
SETXコマンドを使用すると、その場から有効になる。
(VisualStadioなどは起動時に環境変数を読み込んでいるようで、再起動が必要)
SETXコマンドを使用すると、その場から有効になる。
(VisualStadioなどは起動時に環境変数を読み込んでいるようで、再起動が必要)
とあるプログラマーの日常をだらだらとつづってます。
息子:2007年8月生まれ 娘:2011年12月生まれ
#include <iostream>
#include <map>
#include <string>
#include <boost/range/adaptor/map.hpp>
#include <boost/foreach.hpp>
int main()
{
std::map<int, std::string> m;
m[3] = "a";
m[1] = "b";
m[4] = "c";
// キーのみを抽出
BOOST_FOREACH (int key, m | boost::adaptors::map_keys) {
std::cout << key << ' ';
}
std::cout << std::endl;
// 値のみを抽出
BOOST_FOREACH (const std::string& value, m | boost::adaptors::map_values) {
std::cout << value << ' ';
}
}
"#include ""afxres.rc"" // 標準コンポーネント\r\n"
"#include ""afxprint.rc"" // 印刷/印刷プレビュー リソース\r\n"
↓
"#include ""l.jpn\\afxres.rc"" // 標準コンポーネント\r\n"
"#include ""l.jpn\\afxprint.rc"" // 印刷/印刷プレビュー リソース\r\n"
std::wofstream ofs;
ofs.open(L"C:\\temp\\test.txt", std::ios_base::out | std::ios_base::trunc);
ofs << L"test\n";
ofs << L"テスト\n";
std::wofstream ofs;
ofs.imbue(std::locale("Japanese", LC_ALL));
ofs.open(L"C:\\temp\\test.txt", std::ios_base::out | std::ios_base::trunc);
ofs << L"test\n";
ofs << L"テスト\n";
ofs << 1000 << L"\n";
test
テスト
1,000
_wsetlocale(LC_ALL, L"Japanese");
std::wofstream ofs;
ofs.imbue(std::locale("Japanese", LC_COLLATE));
ofs.imbue(std::locale("Japanese", LC_CTYPE));
ofs.open(L"C:\\temp\\test.txt", std::ios_base::out | std::ios_base::trunc);
ofs << L"test\n";
ofs << L"テスト\n";
ofs << 1000 << L"\n";