Signals that C code was AI-generated
C is a small language with a long history of hard-won safety advice. Assistants tend to apply all of that advice at once, which makes their C look like a style guide come to life. Beginners, by contrast, usually learn it one mistake at a time.
- Every allocation checked. Each
mallocfollowed by aNULLtest, an error printed withfprintf(stderr, ...)andexit(EXIT_FAILURE), and a matchingfreefor everything beforemainreturns. - The safe function every time.
fgetsinstead ofscanf("%s"),snprintfinstead ofsprintf, bounds passed alongside every buffer, in work from someone still learning pointers. - Precise types.
size_tfor every length and index,const char *for every input string, andstdbool.hbooleans, applied without a singleintslipping through. - Doxygen-style comments. A
/** @brief ... */block with parameter descriptions above small helper functions in a single-file program. - Ignoring the course helpers. Standard library input handling in a course that supplies its own helper library, such as the
get_intandget_stringfunctions from CS50'scs50.h.
Where C gets hard to judge
C has few ways to express a simple idea, so short programs converge. A student implementing linked-list insertion and a model doing the same will write nearly the same twenty lines, because there is not much else to write. Classic textbook style, especially the K&R tradition many courses still follow, also makes careful human code look uniform. Embedded and systems code is even more constrained by coding standards, which remove personal style almost entirely.
What to do with a high score
Check whether the reasons describe something that does not fit the author. Perfect memory hygiene from a student whose earlier programs leaked memory, or input handling that ignores what the course taught, is worth a question. Then ask the author to explain one pointer manipulation line by line, or to change a function signature and fix the callers. That small exercise is far more telling than the score.
Read more
- C++ AI code detector — for C++ code and contest solutions.
- AI code detection for teachers — running checks fairly in a course.
- AI code checker for homework — for students checking their own work.
Frequently asked questions
Does it distinguish C from C++?
Auto-detect recognises most C programs. If your snippet is short and uses nothing language-specific, choose C in the menu so the analysis reads it against C conventions rather than C++ ones.
Can it check CS50 or other intro course submissions?
Yes, paste the program as submitted. Remember that intro problems are small and tightly specified, so many honest solutions look alike; use the result to decide what to ask the student, not as a finding.
Is careful error checking a sign of AI?
Not by itself. Experienced C programmers check every allocation too. It becomes a signal when the rigour is out of step with the author's level or with the rest of their code.
How long should the snippet be?
A whole program or a function of a few dozen lines. A short loop over an array carries almost no personal style.
Is my C code stored?
No. The snippet goes to a third-party AI model provider (Groq, with Google Gemini as a fallback) for the analysis and the result comes straight back to you. We do not save the code or write it to our logs.