Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

[C] struct incorrect?

I mean you have a few spelling errors mostly... that's one issue. A few others:

Here is a working code. You can delete the for loop, but it shows that you have 7 structs in the array.

Code
#include <stdio.h>
#define N 7
typedef struct
{
    char name [26];
    int score;

} Player;

int main (int argc, char* argv[] ){

    Player players[N];
    printf("Hello world!\n");
    int i;
    for(i = 0; i < N; i++){
        players[N].score = i+1;
        printf("Player %d is made.\n", i+1);
    }
    return 0;
}
There is a section for C related question, post your thread on it.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Help] by .eXeAug 9, 2023 04:41 AM 0 90 Aug 9, 2023 04:41 AM
Last Post: .eXe
[Delphi] by ReversɘЯJun 17, 2016 02:30 PM 4 181 Jun 17, 2016 02:30 PM
Last Post: ReversɘЯ
by cortland12Apr 25, 2016 11:36 AM 2 100 Apr 25, 2016 11:36 AM
Last Post: cortland12