Displaying a table in C++
Solved
alena20
Posted messages
24
Status
Membre
-
alena20 Posted messages 24 Status Membre -
alena20 Posted messages 24 Status Membre -
Hello,
I have a problem displaying the array:
#include <iostream>
using namespace std;
int main()
{
int Array [3]={1,2,3};
cout << Array << endl;
}
And I received the result: 0x7fff6242abf0
Thank you in advance!
Best regards,
Alena
I have a problem displaying the array:
#include <iostream>
using namespace std;
int main()
{
int Array [3]={1,2,3};
cout << Array << endl;
}
And I received the result: 0x7fff6242abf0
Thank you in advance!
Best regards,
Alena
I confirm...
// ostream_iterator example
#include <iostream> // std::cout
#include <iterator> // std::ostream_iterator
#include <vector> // std::vector
#include <algorithm> // std::copy
int main ()
{
std::vector<int> myvector;
int str1[]={1, 2, 3};
myvector.assign (str1,str1+3);
std::ostream_iterator<int> out_it (std::cout,", ");
std::copy ( myvector.begin(), myvector.end(), out_it );
return 0;
}