Anyone know that c program got wat type of error?

Dani AI

Generated

Quick primer that ties together points from this thread (to , , and others): C problems usually fall into a few distinct categories — compile-time errors (syntax, type mismatches, missing declarations), linker errors (undefined reference to a function or symbol), runtime errors (crashes such as segmentation faults, floating-point exceptions), logical/semantic errors (program runs but gives wrong results) and undefined behavior (out-of-bounds access, use-after-free, signed overflow). Compiler warnings are early signals of real bugs and should be treated seriously.

Practical debugging and exam workflow: compile early and fix the first error reported (later errors often cascade); enable warnings (-Wall -Wextra -pedantic) and eliminate them where possible; reduce the problem to the smallest reproducible piece; read error and warning messages carefully — they point to cause, not just symptom. Linker messages like “undefined reference” mean a missing object or wrong function signature. Crashes usually come from invalid pointers, bad indexes, or freed memory.

Tools and quick checks (when available): run the program under a debugger to see where it crashes; use AddressSanitizer or Valgrind to catch invalid memory use; check return values of I/O functions and initialize variables. Common exam pitfalls to review: pointer/array differences, string termination and buffer sizes, correct printf/scanf format specifiers, dynamic memory allocation/freeing, off-by-one loops, and function prototypes/signatures.

A short takeaway echoing earlier posts: treat syntax and logic as separate problems, but also be aware of linker/runtime/UB categories. Compiling often, reading messages, and testing small inputs is the fastest way to find the root cause under time pressure.

Recommended Answers

All 8 Replies

What do you mean?

What do you mean?

Erm, such like syntax error that kind, got what other type of error else?

Erm, such like syntax error that kind, got what other type of error else?

What on earth are you talking about?
Follow the rules of the forum and ask a proper question.

You may not pass this time , good luck next time.

Maybe semantic errors? that the code works but doesn't do what you want?

no idea if sematic is english, (i translated it loosely from dutch)

>Got exam tomorrow
Cool! I've exams too within 3-and-a-half months, wish me the best :P.

>Erm, such like syntax error that kind, got what other type of error else?
So, if I don't misunderstand you, you want to know some kind of syntax error?
Well, that's not very difficult, just try to compile this program and learn the error messages by heart:

#include <stdio.h>

int main(void)
{
  /* Hey, /* this is a very nice comment*/ */
  printf("I would like to get some syntax errors in this program...")
  return something;
}}

:P

commented: Cheeky reply! +4

>Got exam tomorrow
So you've been screwed.
Now did you remember when your instructor told you to read a text book?

>Anyone know that c program got wat type of error?
.

commented: I've exams tomorrow, can you help me? :P +21

Anyone know that c program got wat type of error?

Perhaps you're inquiring about a runtime error?

When I think about programming, the two types of errors that I consider to be significant. These are syntactical errors and logical errors.

Syntax concerns the format of your code and whether the computer can understand what your code says.

Logic concerns whether your program does what you intended it to do.

In order to compile, your code requires correct syntax. Logic, however, it does not.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.