#include <cs50.h>
#include <stdio.h>
int example[];
int main(void)
{
int example = {1,2,3};
for (int i = 0; i < 3; i++) {
printf("%i \n", example[i]);
}
}
Why does this give me the error messages: "Excess elemnts in scalar initializer" at "2" in the array I'm defining, and the error message "Subcripted value is not an array, point or vector" at my "[i]" when trying to print out the Ith integer in the array?
Thanks.
example
to be of? how many elements are you trying to push intoexample
?