I have created a program of arrays to assign value of one array to another array.
This code worked
#include <iostream>
using namespace std;
int main()
{
int arr[]={10,20,30,40,50};
int arr1[]={};
arr1[0]=arr[1];
cout<<arr1[0];
return 0;
}
but the code below did not work.
#include <iostream>
using namespace std;
int main()
{
int arr[]={10,20,30,40,50};
int arr1[];
arr1[0]=arr[1];
cout<<arr1[0];
return 0;
}
can anybody explain why the second code did not work??