Sign in to follow this  
kingpinzs

Putting a varible for a file name

Recommended Posts

390 C:\Dev-Cpp\animation\main.cpp initializing argument 2 of `IDirectDrawSurface7* DDLoadBitmap(IDirectDraw7*, const CHAR*, int, int)' g_pddsone = DDLoadBitmap(g_pdd,"image.bmp",0,0); How can I change "image.bmp to a varible?

Share this post


Link to post
Share on other sites
jfclavette forgot to say that you need to #include <string>.

Another option, if you don't want to use STL is

char* fileName = "test.bmp";
g_pddsone = DDLoadBitmap(g_pdd,fileName,0,0);

Share this post


Link to post
Share on other sites
There shouldn't be a problem passing a string literal for a *const* char*. What exactly are you doing here (please show the surrounding code, and the exact, *full* error message)?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this