2007-11-01から1ヶ月間の記事一覧

バッファ操作1

vc

特定のバッファから別のバッファへ、指定された文字または指定された文字数がコピーされるまで文字をコピーします。 // crt_memccpy.c #include <memory.h> #include <stdio.h> #include <string.h> char string1[60] = "The quick brown dog jumps over the lazy fox"; int main( void ) </string.h></stdio.h></memory.h>…

可変長引数のサポート

vc

http://msdn2.microsoft.com/ja-jp/library/kb57fad8(VS.80).aspx // crt_va.c /* The program below illustrates passing a variable * number of arguments using the following macros: * va_start va_arg va_end * va_list va_dcl (UNIX only) */ #inclu…

ファイルサイズを取得し、ファイルサイズを変更する

vc

ファイルサイズを取得する関数はCの標準にあるのかないのか良く分からん・・・。 // crt_chsize.c // This program uses _filelength to report the size // of a file before and after modifying it with _chsize. #include <io.h> #include <fcntl.h> #include <sys/types.h> #include <sys/stat.h></sys/stat.h></sys/types.h></fcntl.h></io.h>…

キューを使ってみる

c++

ちょっとSTLでキューを扱ってみた。テンプレートを使っているから、intだろうが任意のクラスだろうがいけるっぽい。 #include <queue> #include <iostream> int main() { int i; using namespace std; queue<int> qu; // int型のキュー // 要素のプッシュとポップ qu.push(10); qu.</int></iostream></queue>…

大学にリクルートに行ってきた

本社人事部からのご通達で、大学にリクルートに行ってきた。目的は、学生へ会社説明会をすることと、先生・事務局に説明することである。でも、たいていの学校では、今の10月〜11月という時期は就職希望者はもう全員内定を取ってしまっている。だからと言っ…

はてな記法

スーパーpre記法でシンタックスハイライトを使ってみる。 #include <stdio.h> int main(int argc, char *argv[]) { printf("Hello World!!\n"); return 0; }</stdio.h>

graphvizで日本語

日本語を扱うには、フォント指定して(デフォルトでは文字化けする)UTF-8でファイル保存するだけ。 digraph G { node [fontname="MSGOTHIC.TTC"]; edge [fontname="MSGOTHIC.TTC"]; "こっち" -> "あっち" [label="エッジ1"]; "こっち" -> "そっち" [label=…

久々に再開

ここ2,3ヶ月の間にいろいろ忙しすぎて、こっちのほうが疎かになってしまった。毎日残業とかばっかしだし、初仕事に近い内容ばっかりだったから、単なるコーディングですら、コード中の変数の多さに戸惑ってしまったりしてた。毎日フルキャパシティで働い…