Reputation: 11
I am working on an array problem in which I have to reverse an array. I wrote this code but it is not working:
#include<iostream>
using namespace std;
void rev(int reversed_array[], int arr[], int n)
{
for(int i=0;i<n;i++)
{
reversed_array[i]=arr[i];
}
}
int main()
{
int arr[]={11,2,3,4,5};
int n;
n= sizeof(arr)/sizeof(arr[0]);
int reversed_array[n];
rev(reversed_array,arr,n);
cout<<reversed_array[0];
return 0;
}
It gives me error like:
ld.exe cannot open output file E:\CLG WRK\cpp\Reverse.exe: Permission denied
[Error] ld returned 1 exit status
I tried:
Upvotes: 0
Views: 34