A
asdf
It is best to show me some examples.
Thanks a lot.
Thanks a lot.
It is best to show me some examples.
Thanks a lot.
#include <iostream>
#include <vector>
using namespace std;
vector<pair<int, int> > squares;
int main()
{
for (int i = 0;i < 5;++i)
{
squares.push_back(make_pair(i, i*i));
}
for (vector<pair<int, int> >::const_iterator pos =
squares.begin();pos != squares.end();++pos)
{
cout << pos->first << "^2 = " << pos->second << endl;
}
}
It is best to show me some examples.
Thanks a lot.
#include <iostream>
#include <vector>
using namespace std;
vector<pair<int, int> > squares;
int main()
{
for (int i = 0;i < 5;++i)
{
squares.push_back(make_pair(i, i*i));
}
for (vector<pair<int, int> >::const_iterator pos =
squares.begin();pos != squares.end();++pos)
{
cout << pos->first << "^2 = " << pos->second << endl;
}
}
BobR said:asdf wrote in message...
NOooo problem.
// -------
#include <iostream>
#include <ostream>
int main(){
std::cout << "Hello World" << std::endl;
return 0;
} // main()
// -------
Another example:
// -------
#include <iostream>
#include <ostream>
class Hi{ public:
void Say( std:stream &out ){
out << "Hello World" << std::endl;
return;
}
};
int main(){
Hi Ima;
Ima.Say( std::cout );
return 0;
} // main()
// -------
Your turn.
If that's vector<pair< , > > then I must be really blind as I can't see
it.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.