Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


String question

This topic is 5900 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

Alright I wanna load dome1.bmp, dome2.bmp, and dome3.bmp, and I want to do it in a loop. How do I do that? I''ve done it before but I don''t remember how. It was something like:
for(int iCounter=0;iCounter<=3;iCounter++)
I doubt it is strcat, I don''t even know what I''m saying because this is all off the top of my head. Can anyone help me?

Share this post

Link to post
Share on other sites
I have no idea what this load BMP function is. It's not function VC++ help recognizes, so I'll assume it came from somewhere else. Because of that, I'm going to have to sum it up like this. Please note I have no idea how this LoadBMP function works, so you may have to change the call to it.

for (int loop = 1; loop < 4; loop++){
char name[100]; sprintf(name,"dome%d.bmp",loop);

strcat appends the second string to the first, and I really don't see the need for it if the only part that's changing is the number. If you did want to use those nested strcat functions, however, you'd have to do something about that iCounter, simply because that's an integer, not a string. Using that number would have incorrect output.

Hope this helps!

-Arek the Absolute

[edited by - Arek the Absolute on July 28, 2002 8:19:33 PM]

Share this post

Link to post
Share on other sites
My C++ teacher would be ashamed of me; I forgot about sprintf =P Thanks hehe
Btw it''s OpenGL

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!