Any ideas here? I've spent the past hour trying to fix this, but can't quite get it to work. (very new to C)
Code:
#include <stdio.h>
#include <string.h>
#include "player.h"
int board[3][3];
int maxInput = 3; /* this represents the maximum int they can specify when choosing a position */
struct players player[2];
int isEven();
int main()
{
player[0].name = "john";
printf("%s", player[0].name); //hmmm
getchar();
}
players.h
Code:
#ifndef PLAYER_H_INCLUDED
#define PLAYER_H_INCLUDED
struct players {
char name[256];
char type;
};
#endif // PLAYER_H_INCLUDED
Returns the error:
Code:
C:\Users\Justin\Desktop\Project\Tutorials\main.c|13|error: incompatible types when assigning to type 'char[256]' from type 'char *'|