2012-02-01から1ヶ月間の記事一覧

Doing all right

Yesterday my life was in ruins Now today I know what I'm doin' Gotta feelin' I should be doin' all right Doing all right Where will I be this time tomorrow? Jumped in joy or sinking in sorrow Anyway, I should be doing all right Doing all r…

Keep yourself alive

Take off I was told a million times Of all the troubles in my way Tried to grow a little wiser Little better ev'ry day But if I crossed a million rivers And I rode a million miles Then I'd still be where I started Bread and butter for a sm…

CASLIIマクロ命令展開例

マクロ命令 ”IN IBUF,LEN” PUSH 0,GR1 PUSH 0,GR2 LAD GR1,IBUF LAD GR2,LEN SVC 1 POP GR2 POP GR1 マクロ命令 ”OUT OBUF,LEN” PUSH 0,GR1 PUSH 0,GR2 LAD GR1,OBUF LAD GR2,LEN SVC 2 POP GR2 POP GR1マクロ命令 ”RPUSH” PUSH 0,GR1 PUSH 0,GR…

CASLIIサンプル

1010 1006 2411 1110 1007 8100 3210 0000PGM START ; 元の機械語 (16進) LD GR1,#1006 ; 1010 1006 ADDA GR1,GR1 ; 2411 ST GR1,#1007 ; 1110 1007 RET ; 8100 DC #3210 ; 3210 DC 0 ; 0000 END

C++の入出力で書式を設定するには、マニピュレータを使用する。

#include #include //マニピュレータをいじる時に必要using namespace std;void main(void) { ostringstream oss; char s = '1'; short int si = 0x31; cout oss cout oss.str() }

動的配列をnew()関数で確保する

#include #include using namespace std; void in(vector *i) { int j; for (j = 0; j cout } cout } void main(void) { vector *IN; int i, j; IN = new vector[3]; for (i = 0 ; i for (j = 0; j (*(IN + i)).push_back(j); } } for (i = 0; …

ポイントプログラムをポチっとな

しちゃダメよ。 ウザいから。

16進文字列を 数値に変換する

#include int n; istrstream s(”2a3f”);//ターゲットを指定する必要がある s >> hex >> n;

環境変数を取得

#include #include using namespace std;int main( int argc,char *argv[ ],char *ev[ ]) { for (int i=0;ev[i]!=0;i++) cout return 0; }

ファイルから読み出したものを画面に全て出力

// ファイルから読み出したものを画面に全て出力 #include #include #include using namespace std;int main( ) { ifstream ifs("data.txt"); //ファイルオープン string buf;// ifs を最初につけておけば、ファイルを開くのを失敗したかどうかの点検になる …