Mar 14, 2005 [去年の今ごろ]
C で書いて感動。
かつて BASIC でプログラミング言語に触れて C で挫折した。
それから数年経って Windows と Borland C Compiler と web に情報源を手に入れた今、一から勉強し直している。
今日、ファイルのダンプを表示する処理を関数リファレンスを引きゝ書いてみたら悪戦苦闘の末なんとか出来上がった。かつて BASIC で味わった感動がよみがえってきた。
#include <stdio.h>
#define SCREEN_LINE 24
void main (int argc,char *argv[]) {
FILE *fp;
int i, l, k, n;
unsigned char c[16];
long adr = 0;
if (argc < 2) {
printf ("usage: dump filename\n");
exit(1);
}
if ((fp = fopen(argv[1], "rb")) == NULL) {
printf("file open error.\n");
exit(ENOENT);
}
do {
n = fread(c, sizeof(char), 16, fp);
printf ("%04X ", adr);
adr += 16;
for (i = 0; i < n; i++) {
printf("%02X ", c[i]);
}
printf(" ");
for (i = 0; i < n; i++) {
if (c[i] < 0x20 || c[i] > 0x7e){
c[i] = '_';
}
putchar(c[i]);
}
printf("\n");
l++;
/*
if (l == SCREEN_LINE){
k = getch();
if (k == 0x1b ||
k == 'q' ||
k == 'Q') {
exit(0);
}
l = 0;
}
*/
} while (n > 15);
fclose(fp);
return;
}
Posted at 16:58 - permalink - category: コンピュータ - comments(4) - tags: computer
2005/3/14(Mon)
雪
意外と積もった。
こぶ平から正蔵へ
見た目と印象は変わってない。
asahi.com: 消えゆく「緑のおばさん」 都、最盛期の8分の1
- 勤務内容
- 交通整理
- 事務の手伝い
- 樹木の手入れ
- 勤務地
- 都内
- 給与
- 年700万〜800万円
できるなら就いてみたいこんな仕事。
緑のおばさんが消えゆくことではなく、緑のおばさんの待遇などに対する批判に行政が応じたことがニュースだ。この書き方ではまるで対策を講じた側が悪者に思えてしまう。そんなことを思っていても朝日を憎むことはできない。やじうまワイド好きだからね。
この記事へのコメント
- gu:
- 雪積もって焦った。
- Trackback from Phentermine. :
- [Phentermine.]
- シャネル:
- Please tell me that youre going to keep this up! Its so great and so important. I cant wait to read more from you. I just feel like you know so a lot and know how to make people listen to what youve to say. This weblog is just too cool to be missed. Wonderful things, definitely. Please, PLEASE keep it up! [url=http://www.chan-eljps.com/]シャネル[/url] シャネル
- プラダ 財布:
- Thank you for the appealing read, its not a subject I usually give much attention too but this caught my attention. プラダ 財布
- コーチ 財布:
- Yup, you are right Google is the best in favor of blogging, Google’s webpage as well come up to fast in search engines too.
コーチ 財布 - コーチ バッグ メンズ:
- Have you ever wondered who posts some of this stuff that you come across? Honestly the internet used to be like a different place, recently though it has turned around. What do you think?
コーチ バッグ メンズ - オロビアンコ 財布 メンズ:
- Hi there, this weekend is good in favor of me, as this time i am reading this enormous informative piece of writing here at my residence.|
オロビアンコ 財布 メンズ - Шапка-comme-des-fuckdown-c-4.html:
- плетени шапки http://www.beanies1st.com/Шапка-ncaa-c-11.html Шапка NCAA http://www.beanies1st.com/Шапка-mlb-detroit-tigers-c-9_35.html Шапка Detroit Tigers http://www.beanies1st.com/Шапка-nfl-san-francisco-49ers-c-12_61.html Шапка San Francisco 49ers http://www.beanies1st.com/Шапка-nhl-chicago-blackhawks-c-13_87.html дешевые Шапка Chicago Blackhawks http://www.beanies1st.com/Шапка-nrl-brisbane-broncos-c-14_102.html Шапка Brisbane Broncos
Шапка-comme-des-fuckdown-c-4.html - ポーター バッグ メンズ:
- I think one of your advertisings caused my browser to resize, you might want to put that on your blacklist.
ポーター バッグ メンズ - イルビゾンテ 財布 新作:
- Tumi’s early on leather duffels and clothe bags sacrificed nothing from the name of luxury and fit with late ’70s sartorial feeling.
イルビゾンテ 財布 新作 - コーチ バッグ 激安:
- Very nice post and right to the point. I am not sure if this is actually the best place to ask but do you folks have any ideea where to hire some professional writers? Thanks in advance :)
コーチ バッグ 激安
Posted at 08:34 - permalink - category: 日記 - comments(11) - tags: diary
ページを移動。
これまでの記事。
2007 | 12 | 11 | 10 | 9 | 7 | 6 | 5 | 4 | 3 | 2 | 1 |
2006 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 |
2005 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 |
2004 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 |
2003 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 |
2002 | 12 |
この記事へのコメント