Why I am not able to pass the address of array to index int.(Find Function)

#include
#include

using namespace std;

int main()
{
int num;
cin>>num;
int Array[num];
for (int i = 0; i < num; i++)
{
cin>>Array[num];
}
int key;
cin>>key;
auto it=(Array,Array+num,key);
int index=it-*Array;
if (index==num)
{
cout<<key<<“not present”;
}
else
{
cout<<"present at "<<index;
}
return 0;

}

not able to get it …

not able to solve



please try to explain …

Hello @rprahulpal03 what is the error that you are facing?

Hello @rprahulpal03 this is the corrected code :


if you have any doubt you can ask here:
Happy Learning!!

Thanks … . … .

Hello @rprahulpal03 if your doubt is cleared you can mark this as resolved.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.