I'm absolutely new to C, and right now I am trying master the basics and have a problem reading data from scanf straight into an array.
Right now the code looks like this:
printf("Write down your ID number!\n");
printf("\nThis person is a male.");
else if (array=2)
printf("\nThis person is a female.");
if (array=1) should be
The same with
else if (array=2).
Note that the expression of the assignment returns the assigned value, in this case
if (array=1) will be always true, that's why the code below the if-statement will be always executed if you don't change the
= is the assignment operator, you want to compare, not to assign. So you need
Another thing, if you want only one integer, why are you using array? You might want also to