掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
ビックエンディアンするには? (ID:52683)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
tetrapodさん 一応作成しました。 実際テストしところ・・・ 自分のプログラムミス? スタックオーバーフロー?? バイナリデータの途中にEOF??? はっきりとわかりませんが・・・ 出力結果が、途中で終っています。 以下がプログラムソースです。 ---------------------------------- #include <windows.h> #include "BigEndian.h" #include <stdio.h> #include <stdlib.h> /* exit( ) で必要 */ #include <iostream.h> DWORD BigEndian(LPCTSTR lpFileName1) { FILE *infp; FILE *outfp; int c1; int c2; if ((infp = fopen("4m", "r")) == NULL) { /* ファイルを開けなければ */ /* メッセージを表示して */ fprintf ( stderr, "Can't Open C Source File!\n" ); exit (2); /* 終了 */ } if ((outfp = fopen("test.bin", "w")) == NULL) { /* ファイルを開けなければ */ /* メッセージを表示して */ fprintf ( stderr, "Can't Open C Source File!\n" ); exit (2); /* 終了 */ } do { c1=getc(infp); c2=getc(infp); putc(c2, outfp); putc(c1, outfp); } while (c1!=EOF && c2!=EOF); fclose(infp); fclose(outfp); return SUCCESS; }
←解決時は質問者本人がここをチェックしてください。
戻る
掲示板システム
Copyright 2020 Takeshi Okamoto All Rights Reserved.