|
안녕하세요..
또.. 꼼지락.수야랍니다 ㅡ.ㅡ
alloc를 사용할려고 하는데요... 어디서 어떻게 사용해야하는지를 모르겠습니다. ㅡ.ㅡ
고2때 하고 6년지난 지금 한번도 안써봐서 ㅡ.ㅡ
도무지 기억이 ㅡ.ㅡ ( 흑.. 나이가 ㅠ_ㅠ )
아래 소스상에 어디에 어떻게 써야하는지좀 알려주세요
: : void __fastcall TForm1::Button1Click(TObject *Sender)
: : {
: : if(OpenDialog1->Execute())
: : {
: : FILE *of, *sf;
: : char *buf;
: : long length, i;
: : int ld, wd;
: : char *Fn;
: :
: : ld = 0;
: : wd = 0;
: : i = 0;
: :
: : Fn = OpenDialog1->FileName.c_str();
: :
: : if((of = fopen(Fn, "rt")) == NULL)
: : {
: : ShowMessage("Error Open LoadFile..");
: : return;
: : }
: :
: : if((sf = fopen("c:\\S.mp3", "wb")) == NULL)
: : {
: : ShowMessage("Error Open SaveFile..");
: : return;
: : }
: :
: : fseek(of, 0, SEEK_END);
: : length = ftell(of);
: : fseek(of, 0, SEEK_SET);
: :
: : while(i <= length)
: : {
: : ld = fread(buf, strlen(buf)+1, 1, of);
: : wd = fwrite(buf, strlen(buf)+1, 1, sf);
: : i = i = ld;
: : }
: :
: : StatusBar1->SimpleText = "Complite";
: :
: : fclose(of);
: : fclose(sf);
: : }
: : }
: : //---------------------------------------------------------------------------
|