#include<stdio.h>
#include<stdlib.h>
void show(const double a[], unsigned elements);
int main()
{
const unsigned elements=10;
const double a[10]={0,1,2,3,4,5,6,7,8,9};
printf("\t\tArrays and Pointers\n\n");
show(a,elements);
return 0;
}
//FUNCTION 1
void show(const double a[], unsigned elements)
{
unsigned x;
printf("\nValues in Array are :\n");
printf("[%u]:",elements);
for(x=0; x<elements; ++x)
{
printf("%d",a[x]);
}
printf("\n\n\n");
}
Output:
Arrays and Pointers
Values in Array are :
[10]:0000000000
Why is this outputting zeros??? I have done C++ so I don't see a problem with this code yet, it won't output the elements within the array.