foo.c: In function 'addToHash':
foo.c:69:1: error: conversion to non-scalar type requested
69 | p = (nodeH)malloc(sizeof(nodeH));
| ^
foo.c:70:2: error: invalid type argument of '->' (have 'nodeH' {aka 'struct _nodeH'})
70 | p->key = key;
| ^~
foo.c:71:2: error: invalid type argument of '->' (have 'nodeH' {aka 'struct _nodeH'})
71 | p->next = hash[key % MAX_SIZE];
| ^~
foo.c:72:24: error: incompatible types when assigning to type 'nodeH *' {aka 'struct _nodeH *'} from type 'nodeH' {aka 'struct _nodeH'}
72 | hash[key % MAX_SIZE] = p;
| ^
foo.c: In function 'isInHash':
foo.c:75:11: error: invalid initializer
75 | nodeH p = hash[key % MAX_SIZE];
| ^~~~
foo.c:76:9: error: invalid operands to binary != (have 'nodeH' {aka 'struct _nodeH'} and 'void *')
76 | while(p != NULL){
| ^~
foo.c:77:5: error: invalid type argument of '->' (have 'nodeH' {aka 'struct _nodeH'})
77 | if(p->key == key)
| ^~
foo.c:79:6: error: invalid type argument of '->' (have 'nodeH' {aka 'struct _nodeH'})
79 | p = p->next;
| ^~
foo.c: In function 'addToQueue':
foo.c:88:1: error: conversion to non-scalar type requested
88 | tail->next = (nodeQ)malloc(sizeof(nodeQ));
| ^~~~
foo.c: In function 'main':
foo.c:41:1: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
41 | scanf("%s", line);
| ^~~~~~~~~~~~~~~~~
正在同步测试数据,请稍后
[Hydro](https://hydro.ac)提供评测服务