Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

A correct C solution to Clone Graph does not compile

未关闭
#332 0 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 1 天内回复

@Wu-1127 已经在做这个了。

开始于 2026年10月17日。

  • #333 来自 @Wu-1127 —— 未关闭

评估

这个 Issue 还没有评估数据。

描述

Observed behavior

The C starter for Clone Graph (shown as Sandbox Topology Replica) documents the node as struct Node { int val; int numNeighbors; struct Node** neighbors; }, matching LeetCode's C template, but the C harness in web/compiler-explorer.js declares that field as neighborsSize. A correct solution that follows the documented struct fails to compile with four no member named 'numNeighbors' errors, so no test case runs. The compiler note now points only at <test harness>, so the name the harness expects is not shown anywhere a candidate can read it.

Expected behavior

A solution written against the struct in the starter comment compiles and is graded. Renaming the field to neighborsSize in the same solution passes all five cases, so only the field name differs.

Reproduction
  1. Open Sandbox Topology Replica and select C.
  2. Write a DFS clone that uses the documented field, e.g. clone->numNeighbors = node->numNeighbors; and for (int i = 0; i < node->numNeighbors; i++).
  3. Run the tests.
CodeTrial version

codetrial 0.1.0 (34f5617)

Environment

OS: macOS <26.4.1> (arm64)
Browser: chrome <155.0.8059.40 >
Language: C
Interview loop: coding
Problem: Sandbox Topology Replica (Clone Graph)
REACTO or STAR step: Code (running tests)
Reconnect: none

Sanitized evidence
<source>:19:12: error: no member named 'numNeighbors' in 'struct Node'; did you mean 'neighbors'?
   19 |     clone->numNeighbors = node->numNeighbors;
<test harness>: note: 'neighbors' declared here
<source>:22:31: error: no member named 'numNeighbors' in 'struct Node'; did you mean 'neighbors'?
   22 |     for (int i = 0; i < node->numNeighbors; i++) {
4 errors generated.
Public data confirmation
  • I removed credentials, session tokens, candidate recordings, and personal interview content from this public report.
主要语言
Rust
星标
160
派生
64
平均合并
1 天 12 小时
30 天内合并 PR
124

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

sysprog21/codetrial 的其他 Issue

查看 sysprog21/codetrial 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。