I keep getting the message that 'non-ASCII characters are not allowed outside of literals and identifiers.' I get this message when I compile and it is at the strcpy section. Any help gratefully accepted. program in C
// Implements a dictionary's functionality
#include <ctype.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include "dictionary.h"
// Represents number of buckets in a hash table
#define N 26
// Represents a node in a hash table
typedef struct node
{
char word[LENGTH + 1];
struct node *next;
}
node;
// declare words to count in dictionary
int dictionarysize = 0;
// Represents a hash table
node *hashtable[N];
// Hashes word to a number between 0 and 25, inclusive, based on its first letter
unsigned int hash(const char *word)
{
return tolower(word[0]) - 'a';
}
// Loads dictionary into memory, returning true if successful else false
bool load(const char *dictionary)
{
// Initialize hash table
for (int i = 0; i < N; i++)
{
hashtable[i] = NULL;
}
// Open dictionary
FILE *file = fopen(dictionary, "r");
if (file == NULL)
{
unload();
return false;
}
// Buffer for a word
char word[LENGTH + 1];
// Insert words into hash table
while (fscanf(file, "%s", word) != EOF)
{
// TODO
node *new_node = malloc(sizeof(node));
if (new_node == NULL)
{
unload ();
return false;
}
else
{
strcpy (new_node → word, word);
}
//implement hash function to get an index
int index = hash(word);
// if corresponding index in hashtable is empty, assign it to the new node
// else append new node to the start of the linked list
if (hashtable[index] == NULL
{
hashtable[index] = new_node;
}
else
{
new_node→next = hashtable [index];
hashtable [index] = new_node;
}
dictionarysize++;
}
// Close dictionary
fclose(file);
// Indicate success
return true;
}
''''''''''