so I tried to follow what the link you sent me was describing. I still
don't really get how to do this. the specifications say the program
should take in the vector values as such:
Size of the vector: 3
Vector value: 2 2 1
size of the vector is the 'n' input that i would pass in to
so i'm thinking of something like this...
void read_vector(int *v, int n)
int i = 0,
value = 0;
printf("Vector value: ");
while (getchar() != '\n')
scanf("%d", &value); v[i] = value;
but for some reason i still get an error... what's interesting is that it won't even get to the printf statement at the beggining....maybe its something from the previous function where the porblem lies???
int n1, n2;
printf(" Size of the first vector: "); // vector 1
printf(" Size of the second vector: "); // vector 2
int nres = (n1 >= n2 ? n1: n2);
if ( vector_addition(vector_1, n1, vector_2, n2, result) == true)
else printf("Error: vectors must be equal in size. Addition undefined.");
i don't know what the hell is going on really.... haha.. I'm learning sorry.
this is what I get in the prompt:
Enter your selection[1..7]: 1
Size of the first vector: 3