Hello. Loved Java, but having trouble with c++. Been working for hours, and finally finished my project. I have one more small problem, and I can't figure it out and it's gotta be so simple please help.
I need to re-write this using pointers rather than arrays. It also says I have to include salary[20]; It says to name my pointer ps and to use initialize it to first space in the array and use it in the body of the loop.
ORIGINAL
1 2 3 4 5 6 7 8 9 10 11 12 13
int main()
{
int salary[20];
int i;
for (i=0; i < 20; ++i)
{
cout << "Enter Salary: ";
cin >> salary[i];
}
for (i=0; i < 20; ++i)
salary[i]=salary[i]+salary[i]/(i+1);
return 0;
}