I am having a hard time grasping the concept of Arrays... I have read about 100 different resources on arrays (Generic at this point) and cannot seem to figure it out.
Here is my attempt at what I think is a simple array.
Code:
#include <stdio.h>
int main()
{
float a[13]; // Days of Christmas items
a[0] = Nothing;
a[1] = A Partridge in a Pear Tree;
a[2] = Two Turtle Doves;
a[3] = Three French Hens;
a[4] = Four Calling Birds;
a[5] = Five Gold Rings;
a[6] = Six Geese A-laying;
a[7] = Seven Swans A-swimming;
a[8] = Eight Maids A-milking;
a[9] = Nine Ladies Dancing;
a[10] = Ten Lords A-leaping;
a[11] = Eleven Pipers Piping;
a[12] = Twelve Drummers Drumming;
printf("On the ____ day of Christmas your true love gave to you\n");
printf("Enter the day of Christmas\n");
scanf("%f", &a);
getchar();
}
However when I compile this I get a return error of my floats being undeclared. Am I even on the right track, is this even an array?
Thank You in advance.