This is a very simple question and I feel stupid for asking it, but I am pressed for time and I need to figure it out :)
I just need to know how to make a string that contains text and other variables. For instance in Java I can just do this:
String someString;
for(int i = 0; i>10; i++){
someString = ("this text has printed " + i + " times"); //how do I create this line in C++?
System.out.println(someString);
i++;
}
EDIT 4:
Ok, Rahul G's answer below works pretty good, and the program compiles and ok, but when I run it instead of getting the string I want for the file name, I get a bunch of numbers. For instance: << "frame " << i << " .jpg"
creates: "013679000.jpg" instead of "frame 0.jpg" like I want. Any thoughts?
for(int i = 0; frames; i++)
{
frame = cvQueryFrame(capture);
std::string s = static_cast<std::ostringstream &>(std::ostringstream() << argv[1] << i << " .jpg").str();
cvSaveImage(s.c_str(), frame);
}