#include <algorithm>
#include <iterator>
std::copy( std::begin( b ), std::end( b ), std::begin( a ) );
Last edited on
Another way is to use std::array. For example
std::array<int, 10> a;
std::array<int, 10> b = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
a = b;
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
#include <iostream>
#include <conio.h>
using namespace std;
int main()
{
double dt;
int j=41;
double y[45],uy[45];
cout<<"Enter time step interval of your choice : ";
cin>>dt;
for(int i=1;i<=j;i++)
{
if (i==1)
{
y[i]=40;
}
else
{
y[i]=0;
}
}
getch();
}
|
Here, I want to copy y[i] to uy[i]. I tried using std::array. But it gives error as
`array' is not a member of `std' .
Please Help.
Last edited on
I do not see where uy is defined and how you are goint to copy y to uy,
I have edited the code. Now its having uy array.
I tried your two of your methods but my compiler is giving me either
`array' is not a member of `std' .
or
`begin' is not a member of `std' .
Thank you a Lot. It worked Finally.