C/C++の宿題を片付けます 104代目at TECH
C/C++の宿題を片付けます 104代目 - 暇つぶし2ch483:デフォルトの名無しさん
08/02/29 01:06:59
>>481
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdlib.h>
#define BSIZE 128
int main(int argc, char **argv){
int rfd, rdnum
char buf[BSIZE];
if ((rfd = open(argv[1], O_RDONLY)) == -1) {
perror(argv[1]);exit(1);
} else {
printf("ファイルのオープンに成功しました\n");
}
while(1){
if ((rdnum=read(rfd,buf,BSIZE))<1) break;
printf(" %d\n",rdnum);
}
close(rfd);
return 0;
}



次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch