#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int *p, i, a;
p = (int*) malloc(4*sizeof(int));
for(i=0;i<4;i++)
{
cin >> a;
*(p+i) = a;
}
cout << endl;
for(i=0;i<4;i++)
{
cout << *(p+i) << " ";
}
cout << endl;
return 0;
}
#include<cstdlib>
using namespace std;
int main()
{
int *p, i, a;
p = (int*) malloc(4*sizeof(int));
for(i=0;i<4;i++)
{
cin >> a;
*(p+i) = a;
}
cout << endl;
for(i=0;i<4;i++)
{
cout << *(p+i) << " ";
}
cout << endl;
return 0;
}
Comments
Post a Comment