im studying programming fundamentals..I dont know what is the commands and syntax of c language, pls can u give me some definition and information about c language...thnks!!!!!!!!! ;)

Dani AI

Generated

A very short, practical primer that fills gaps in the replies below.

C programs are made of functions, statements and declarations. The program entry point is main; statements end with ;; blocks are delimited with {}. Types (like int, char, float) must be declared before use. String literals need double quotes and format functions (like printf) require the correct format specifier for each type.

A minimal, correct example illustrating those points:

#include <stdio.h>

int main(void) {
    int count = 3;
    printf("count = %d\n", count);
    return 0;
}

Notes on the example and common pitfalls: the #include line makes printf visible; the string "count = %d\n" must be quoted and %d matches an int; forgetting the quotes or the matching specifier often produces warnings or undefined behavior. Use int main(void) and return an integer; older K&R-era syntax is terse and can confuse beginners, which is why 's K&R recommendation is best used as a reference rather than a first tutorial. and are right that online docs and examples are extremely helpful — combine a concise reference with hands-on exercises.

Quick troubleshooting checklist: compile with warnings enabled (for example, gcc -std=c11 -Wall -Wextra -o prog prog.c), read the exact compiler messages, watch for "missing ;", "undeclared identifier", or "format mismatch" warnings, avoid unsafe functions like gets (removed from modern C), and use tools such as Valgrind for memory issues. 's sample illustrates common beginner errors (missing quotes and return type); the corrected example above shows the safer, standard form.

Recommended Answers

All 8 Replies

>im studying programming fundamentals..
Then why are you learning C?

>pls can u give me some definition and information about c language
Get a good book. Online tutorials have a tendency to suck ass. A good tutorial/reference book is The C Programming Language by Kernighan and Ritchie.

Online tutorials have a tendency to suck ass. A good tutorial/reference book is The C Programming Language by Kernighan and Ritchie.

>>This book will suck ur brain out.

This book will suck ur brain out.

Only if it wasn't properly attached to the common sense.

>pls can u give me some definition and information about c language
Get a good book. Online tutorials have a tendency to suck ass.

not from my experience. every time i buy a programming book, it ends up sitting on the shelf while i find the best documentation online.

I think the question is how one make use of the information at hand, regardless of the source. In this case, who care whether it is a book or an online tutorial?

books are expensive.

Well from the basic's C is well one of the most flaxible language's with almost every person in this forum looking at it, almost every day. Well some of us. Now I wouldnt say C is based on commands. But more of what you tell it to do using variable's, interger's, floating points ETC. The # 1 used instruction you will give it is #include <the library you choose.h, which is most likey stdio.h, or stdlib.h. Abbrivation of coarse. Lasy programmers!. stdio means standard input/output, stdlib means standard libary. Tere are a lot of librarys i can not get in to at this moment. Also with C, everything needs a function printf(), main() etc etc. lol. You will learn more of that in class or book's. Heres a basic set up.

#include <stdio.h>
main()
{
printf(hello sexy); /*this is a comment. thjese make a program easier to read when needing edit's. The /, make it so that the program wont read it as a sequence. All programs, and lines of code have to produce and ending sequence. In C that is ;. Other wise C would keep going producing a syntax error, because it is a computer and doesnt know what to do. lol =) */
}

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.