im studying programing fundamentals. I dont know what is the commands and syntax of c language..can u give me some information and tutorials about this c language....coz, i can't find any website about c language, is there any tips on creating basic programs..thnks!!!!!

Dani AI

Generated

This thread asked for the "commands and syntax" of C (original question by ). Replies correctly pointed to beginner tutorials and a compiler () and recommended the classic book by . A quick orientation: C has keywords, statements, expressions, functions and preprocessor directives — not shell-style "commands." Key syntax points: statements end with ;, blocks are { }, identifiers are case-sensitive, comments use // or /* ... */, and format specifiers (like %d for int) must match types.

A minimal working program:

#include <stdio.h>

int main(void) {
    printf("Hello, world\n");
    return 0;
}

#include brings in declarations (here printf). main is the entry point and returns an exit code. Common compile errors are missing ; or mismatched {}.

A short example showing a function and a loop:

#include <stdio.h>

int add(int a, int b) {
    return a + b;
}

int main(void) {
    for (int i = 0; i < 5; ++i)
        printf("%d\n", add(i, i));
    return 0;
}

Example compile command (GCC):

gcc -Wall -Wextra -std=c11 -o prog prog.c

Practical learning notes and common pitfalls: enable warnings (-Wall -Wextra) and fix them; compile often and read error messages carefully; uninitialized variables, wrong format specifiers, buffer overflows (unsafe scanf usage), and invalid pointer access cause most runtime failures. There are several ISO C versions (C89/C90, C99, C11, C17, C23); specifying -std= controls the dialect. The suggestions already in the thread are solid starting points; small, incremental programs and checking compiler feedback make basic C concepts sink in more quickly.

Recommended Answers

All 4 Replies

Take a beginner's look at:

The best way to get the hang of it is to write a few programs. There is also a great free C compiler at:

Go to the nearest bookstore selling computer books. If they're halfway decent they'll have a shelf of books related to C including tutorials.
Also pick up a copy of the standard work "the C programming language" by Kernighan and Richie

Please don't post multiple threads with the same question.

thanks a lot guys

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.