以下c语言代码转换为pascal语言(100分)

  • 主题发起人 主题发起人 coldease
  • 开始时间 开始时间
C

coldease

Unregistered / Unconfirmed
GUEST, unregistred user!
struct mpstr { char c[40000];
};
#define MP3_ERR -1
#define MP3_OK 0
#define MP3_NEED_MORE 1
typedef BOOL (*INITMP3) (struct mpstr *mp);
typedef void (*EXITMP3) (struct mpstr *mp);
typedef int (*DECODEMP3) (struct mpstr *mp, char *inmemory, int inmemsize,
char *outmemory, int outmemsize, int *done);
#define TEXT_INITMP3 "_InitMP3"
#define TEXT_EXITMP3 "_ExitMP3"
#define TEXT_DECODEMP3 "_decodeMP3"
 
//struct mpstr { char c[40000];
};
const
MP3_ERR = -1;
MP3_OK = 0;
MP3_NEED_MORE = 1;
type
PMPStr = ^TMPStr;
//刚写错,原来是结构来着 :)
TMPStr = record
c: array [0..40000 - 1] of Char;
end;

//函数方法指针
function TInitMP3(lpMP: PMPStr): Boolean;
procedure TExitMP3(lpMP: PMPStr);
function TDecodeMP3(lpMP: PMPStr;
InMemory: PChar;
InMemSize: Integer;
OutMemory: PChar;
OutMemSize: Integer;
Done: PInteger): Integer;
const
TEXT_INITMP3 = '_InitMP3';
TEXT_EXITMP3 = '_ExitMP3';
TEXT_DECODEMP3 = '_decodeMP3';
 
//函数方法指针
应该为:
TInitMP3 = function(lpMP:PMPStr):Boolean;
TExitMP3 = procedure(lpMP: PMPStr);
TDecodeMP3 = function(lpMP: PMPStr;
InMemory: PChar;
InMemSize: Integer;
OutMemory: PChar;
OutMemSize: Integer;
Done: PInteger): Integer;
 
****,只记得一点点写成pascal,忘了转语法了。[:D][:D][:D][:D][:D][:D]
 
多人接受答案了。
 
后退
顶部