ページ 11

Dxライブラリでprintfが使えません

Posted: 2017年2月18日(土) 13:53
by c中
DXライブラリでprintエフ関数が使えません。stdio.hをincludeしてもできません
苦cで1通りやって覚えた関数を使おうと思ったのですが
使えないのでしょうか?

Re: Dxライブラリでprintfが使えません

Posted: 2017年2月18日(土) 15:26
by Math
使えますよ!

コード:

//#include <windows.h>
//#include <stdio.h>
#include "DxLib.h"
int WINAPI WinMain(HINSTANCE,HINSTANCE,LPSTR,int)
{   //コンソールAllocation
    AllocConsole();FILE* out = 0; freopen_s( &out, "CON", "w", stdout );
    printf("\n\n[..Hello World!..]\n\n");

    printf("\n\n[..%d..]\n\n",12345);

    MessageBox(NULL, "[..DxLibが動きますよ..]", "[メッセージボックス]", 0);

    ChangeWindowMode( TRUE );DxLib_Init();
    DrawString(100, 70, "[DxLib: Hello World!]", GetColor(255, 255, 255));
    printfDx("..ABCD1234..");printf("\n\n[..DxLibが別画面で表示されましたか?..]\n\n");
    WaitKey();DxLib_End();

    fclose( out );FreeConsole();return 0;//コンソール解放
}

Re: Dxライブラリでprintfが使えません

Posted: 2017年2月18日(土) 19:25
by c中
ありがとうございます!

Re: Dxライブラリでprintfが使えません

Posted: 2017年2月18日(土) 19:26
by c中
^^)い