This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <vector> | |
#include <unordered_map> | |
#include <algorithm> | |
#include <iostream> | |
auto main()->int | |
{ | |
std::ios::sync_with_stdio(false); | |
// vector -> map |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <vector> | |
#include <unordered_map> | |
#include <algorithm> | |
#include <iostream> | |
auto main()->int | |
{ | |
std::ios::sync_with_stdio(false); | |
// vector -> map |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <vector> | |
#include <unordered_map> | |
#include <algorithm> | |
#include <iostream> | |
auto main()->int | |
{ | |
std::ios::sync_with_stdio(false); | |
std::unordered_map<std::string, int> m {{"a",1},{"b",2},{"c",3},{"d",4}}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <list> | |
#include <algorithm> | |
#include <iterator> | |
int main() | |
{ | |
std::list<int> ls { 12, 2, 3, 1, 5, 4, 13, 7, 8, 9, 10, 11, 6}; | |
// とりあえず出力 | |
std::copy(ls.begin(), ls.end(), std::ostream_iterator<int>(std::cout, " ")); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scriptencoding utf-8 | |
" vim:set ts=8 sts=2 sw=2 tw=0: (この行に関しては:help modelineを参照) | |
" | |
" An example for a Japanese version gvimrc file. | |
" 日本語版のデフォルトGUI設定ファイル(gvimrc) - Vim7用試作 | |
" | |
" Last Change: 07-May-2013. | |
" Maintainer: MURAOKA Taro <koron.kaoriya@gmail.com> | |
" | |
" 解説: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define GLOBAL_VARIABLE_DEFINED /* 実体はこっち */ | |
#include "global.h" | |
#include "a.h" | |
#include <stdio.h> | |
int main() | |
{ | |
bar_proc(); | |
g_FooBar.a = 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "a.h" | |
#include <stdio.h> | |
#include "Global.h" | |
// 構造体の完全な定義を書く | |
typedef struct tag_bar | |
{ | |
int a; | |
int b; | |
char c[4]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef A_H_INCLUDED__ | |
#define A_H_INCLUDED__ | |
// 公開関数 | |
void bar_proc(); | |
// 下記は非公開 ちなみに.cにかいてstaticにする | |
//void bar_proc_1(Bar *bar); | |
//void bar_proc_2(Bar *bar, int n); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef GLOBAL_H_INCLUDED__ | |
#define GLOBAL_H_INCLUDED__ | |
// グローバル変数の名前の衝突を避けるための工夫 | |
#ifdef GLOBAL_VARIABLE_DEFINED | |
# define GLOBAL /* INSTANCE */ | |
#else | |
# define GLOBAL extern /* EXTERN */ | |
#endif /* GLOBAL_VARIABLE_DEFINED */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package prin.com; | |
import java.util.ArrayList; | |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.Map; | |
// なんでこんな構造になっているのかっていうツッコミはあると思いますが | |
// 説明のため あくまで簡易的な例です。 | |
// idはA00000の形式で作られていて最初のアルファベットで部署が紐づいている |
NewerOlder