No, you can't make an array in the way you're thinking. At least not that simply. The example in the post you've given is for giving different arguments for array elements of the same type.
Hashimatsu wrote:
I want to create an array with 5 seperate containers containing 2 integers and 1 string.
I'm not quite sure I understand your needs. Would the following not suffice?
1 2 3 4 5 6 7 8 9 10 11 12 13
#include <iostream>
#include <string>
struct Container
{
int a, b;
std::string s;
};
int main( int argc, char* argv[] )
{
Container arr[5];
}
Yeah, it's possible to make that work. A little context would help, though. What are you trying to do specifically?
I mean, I know you're trying to create an array of objects that contains string and integer data but what do they represent? Names? Ages?
EDIT: The error messages are because you're not treating arr as an array. Also, you're not calling create function correctly - you're missing the parenthesis.
Like I said, though, if you give me a bit of a better idea of what you're creating then I can advise a little more specifically.