Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><code>infoArray</code> is declared a <code>int</code>. It does not provide structure elements like <code>infoArray.studentID</code>. That causes the compiler to complain <em>... something not a structure or union.</em></p> <p><code>infoArray [students];</code> with <code>int students = 0;</code> is questionable too.</p> <p>You'd get (rewritten to suit the need. However, with some open questions):</p> <pre><code>#include &lt;stdio.h&gt; #include &lt;stdlib.h&gt; #define MAX_STUDENTS 200 typedef struct { int studentID; int year; int month; int day; int phone; int end; } info_TYPE; int main (void) { info_TYPE infoArray [MAX_STUDENTS]; int students = 0; while (infoArray[students].end != -1) { printf("Enter student information (ID, day, month, year, phone)\n"); printf("Enter -1 following the phone number to end the process to continue enter 0\n"); scanf("%d %d %d %d %d %d", &amp;infoArray[students].studentID, &amp;infoArray[students].day, &amp;infoArray[students].month, &amp;infoArray[students].year, &amp;infoArray[students].phone, &amp;infoArray[students].end); students = students + 1; if (students &gt;= MAX_STUDENTS) break; } if (infoArray[students - 1].end = -1) printf("You entered %d student(s)\n", students); printf("Enter Student ID", infoArray[students - 1].studentID); // no idea what this line was for, presumably another previous attempt. scanf("%d", infoArray[students - 1].studentID); // getting tired to follow the speed at which the question is modified, presumably last edit here! } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload