Jump to content
  • Advertisement
Sign in to follow this  
kingpinzs

Putting a varible for a file name

This topic is 4624 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!