My Name is Leonard E. Norwood Jr. I'm Undergraduate student from Norfolk State University in Norfolk Virginia.
Getting down to the point, my program is supposed to print out a list of pre-set numbers in reversal. I used pointers for this, however, something went wrong so I'm trying my best to trace this program and assume that there is something wrong with one of the for loops that is causing something to happen. This program can compile but nothing is happening, I just need some slight assitance.
#include <stdio.h>
{
int i, j;
float ar[5] = {12.75, 18.34, 9.85, 23.78, 16.96}, br[5];
float *ptrAr, *ptrBr;
ptrAr = ar;
ptrBr = &br[4];
for ( i = 0; i < 5; i++) {
*ptrBr = *ptrAr;
ptrAr++;
ptrBr--;
}
for ( i = 0; i < 5; i++) {
printf("%5.2f\n", *ptrBr);
ptrBr++;
}
return 0;
}