Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

over 4 years ago

Language

C

Compiler

gcc 10.1.0

Options
Warnings
C11(GNU)
no pedantic

Author

anonymous

over 4 years ago

$ gcc prog.c -Wall -Wextra -std=gnu11
prog.c: In function 'hash':
prog.c:20:20: error: 'm' undeclared (first use in this function)
   20 |     return (sum+i)%m;
      |                    ^
prog.c:20:20: note: each undeclared identifier is reported only once for each function it appears in
prog.c: In function 'createHashTable':
prog.c:29:22: error: 'm' undeclared (first use in this function)
   29 |     ht->array=malloc(m*sizeof(hashElem *));
      |                      ^
prog.c: In function 'printHashTable':
prog.c:39:20: error: 'm' undeclared (first use in this function)
   39 |     for(int i=0; i<m; i++)
      |                    ^
prog.c: At top level:
prog.c:45:34: error: unknown type name 'keyType'
   45 | int insert(struct hashTable *ht, keyType key){ //insert function... which is a mess but should work
      |                                  ^~~~~~~
prog.c: In function 'hash':
prog.c:21:1: warning: control reaches end of non-void function [-Wreturn-type]
   21 | }
      | ^
Exit Code:
1