   generating screenshot file names
  I'm writting a game in C++/oGL, I need to be able to take screenshots. The actual writting the .bmp file is np, but I have no clue how to do the Screenshot0001.bmp Screenshot0002.bmp Screenshot0003.bmp Screenshot0004.bmp....Rather than just keep a list I want to be able to something like "GetListOfFileIesFolder("Screens");"Is there a way to do that in C++?   
Here's an example of how to list files in a directory. After you've done this, you can parse the filenames and create a new filename based on that information. (Windows)   ;  You can just do something like this if you don't want to rely on operating system libraries:int num = 1;string name = "Screenshot";string extension = ".bmp";//find the next available filenamestring fileName;while(true){fileName = name + num + extension;fstream file(fileName.c_str(), ios::in);if(!file.is_open())break;//no need to close the file, it will be done automagically}//good, now we can open it and actually use itfstream file(fileName, ios::out | ios::binary);file.write(...);EDIT: I was being fast and loose, you cant actually do fileName = name + num + extension; Consider it as pseudo-code :-)[Edited by - deathkrush on June 12, 2006 3:00:17 AM]