/ Vijos /

记录详情

Compile Error

foo.c: In function 'addToHash':
foo.c:66:1: error: conversion to non-scalar type requested
 p = (nodeH)malloc(sizeof(nodeH));
 ^
foo.c:67:2: error: invalid type argument of '->' (have 'nodeH {aka struct _nodeH}')
 p->key = key;
  ^~
foo.c:68:2: error: invalid type argument of '->' (have 'nodeH {aka struct _nodeH}')
 p->next = hash[key % MAX_SIZE];
  ^~
foo.c:69:22: error: incompatible types when assigning to type 'nodeH * {aka struct _nodeH *}' from type 'nodeH {aka struct _nodeH}'
 hash[key % MAX_SIZE] = p;
                      ^
foo.c: In function 'isInHash':
foo.c:72:11: error: invalid initializer
 nodeH p = hash[key % MAX_SIZE];
           ^~~~
foo.c:73:9: error: invalid operands to binary != (have 'nodeH {aka struct _nodeH}' and 'void *')
 while(p != NULL){
         ^~
foo.c:74:5: error: invalid type argument of '->' (have 'nodeH {aka struct _nodeH}')
 if(p->key == key)
     ^~
foo.c:76:6: error: invalid type argument of '->' (have 'nodeH {aka struct _nodeH}')
 p = p->next;
      ^~
foo.c: In function 'addToQueue':
foo.c:85:1: error: conversion to non-scalar type requested
 tail->next = (nodeQ)malloc(sizeof(nodeQ));
 ^~~~
foo.c: In function 'main':
foo.c:38:1: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
 scanf("%s", line);
 ^~~~~~~~~~~~~~~~~
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1252 @.@斗地主
语言
C
递交时间
2021-07-19 15:11:22
评测时间
2021-07-19 15:11:22
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes