Why the below gives different Outputs?
#include<iostream>
using namespace std;
int* sqcb(int n)
{
int a[3];
a[0]=n*n;
a[1]=n*n*n;
a[2]=786;
return a;
}
int main()
{
int a,c;int const *b;
cout<<"Enter an Integer:";
cin>>a;
b=sqcb(a);
cout<<*(b)<<"\t"<<*(b+1)<<"\t"<<*(b+2)<<"\t"; // <- this
cout<<*(b)<<"\t"; // <- and these
cout<<*(b+1)<<"\t"; //
cout<<*(b+2)<<"\t"; //
}