Here is the whole code with the error.
Code:
#include <stdio.h>
#define VECTOR_LENGTH 3
int main (void)
{
/* declare variables */
int option, i;
float Xr, Yr, Zr ;
float Xv, Yv, Zv, Xu, Yu, Zu ;
float vector1[VECTOR_LENGTH] ;
scanf("%1f %1f %1f", &Xv, &Yv, &Zv);
vector1[VECTOR_LENGTH] = {Xv, Yv, Zv} ;
printf("The first Element in the array Vector1 is : %3f \n\n", vector1[0]);
the error is apparently on the line
Code:
vector1[VECTOR_LENGTH] = {Xv, Yv, Zv} ;
and the error is
Code:
error: expected expression before ‘{’ token
can anyone tell me why this error is coming up and how i could go about fixing it so that the assigned values come up when i use the printf function.