Hi guys, I started learning C a few days ago, watching as many youtube tutorials as possible but there aren't many tuts on youtube :/

Can anyone recomend me a good book or list of tutorials? I started to read "The C Programming Language" by dennis ritchie but It's a little advanced and confusing for me :/ I need somewhere to start off.

Heres a program I wrote, I'm including this to show how nooby I am in C, I really am a complete begginer :/

#import <stdio.h>
#import <conio.h>

int main(void)
{
    /* This is my Random Number Generator, By bckc */
	
	
    int bc;
    int kc;
    int owns;
    srand(time(NULL));
    
    bc = 0;
    kc = 0;
    
    
    printf("How many numbers do you want to generate? \n");
    scanf("%d", &kc);
    
    printf("\nWhat is the highest number you'd like to be displayed?\n");
    scanf("%d", &owns);
    
    printf("\n\nHit any key to generate %d", kc);
    printf(" random numbers between 1 and %d", owns);
    printf(". \n\n");
    
    
    getch();
    
    while(bc<kc){
                 printf("%d\n", 1+rand()%owns);
                 bc++;
                 }  
    

    printf("\n\nClick any key to close. Cheers, Bckc.");

    getch();
    
}

Dani AI

Generated

The sample program posted by is a good first step: it combines I/O, loops and rand() — the core building blocks for early practice. The rest of the thread points in useful directions: check the forum sticky as advised, note ’s recommendation for a gentle, modern textbook, and remember ’s later correction about some popular regional texts. Below are concise, practical fixes and a small, portable template that beginners can apply immediately.

Common, quick fixes and cautions

  • Use standard headers and directives: #include, not #import.
  • Avoid nonstandard, platform-specific headers like conio.h and functions like getch(); they harm portability.
  • Seed rand() with srand((unsigned)time(NULL)) and include <stdlib.h> and <time.h>.
  • Always check scanf (or use fgets + strtol) to validate input and avoid undefined behavior.
  • Compile with warnings on (for example, -Wall -Wextra) and treat warnings seriously.

A small, portable template (apply immediately)

#include <stdio.h>
#include <stdlib.h>
#include <time.h>

int main(void) {
    int count = 0, max = 0;
    if (scanf("%d", &count) != 1 || count <= 0) {
        fprintf(stderr, "Invalid count\n");
        return 1;
    }
    if (scanf("%d", &max) != 1 || max <= 0) {
        fprintf(stderr, "Invalid max\n");
        return 1;
    }
    srand((unsigned)time(NULL));
    for (int i = 0; i < count; ++i)
        printf("%d\n", 1 + rand() % max);
    return 0;
}

Next steps and practice ideas
Learners should follow a short cycle: read a clear chapter (exercise-heavy), type and run each example, then modify it into a tiny project (file I/O, string parsing, simple data structures). Use a modern toolchain (gcc/clang on Linux, MinGW/MSYS2 on Windows), enable warnings, and run tools like Valgrind or a debugger to understand runtime issues. Books recommended in the thread offer different styles: look for one that explains pointers, memory management and the standard library with lots of exercises.

Recommended Answers

All 9 Replies

Heres a program I wrote, I'm including this to show how nooby I am in C, I really am a complete begginer :/

Since you are asking about books only , its not necessary to include these type of sentences and programs to show that you are a beginner , instead you can just ask about the books.

Dennis Ritche is the best book for C programming language.
Some other books for beginners:-
Let Us C- by Yashwant Kanitar
Mastering in C -by VenugopalRao
These are really good books for beginners but you should also go through dennis Ritchie.
remember don't just stick on studying books follow them and keep practicing.
Practice will clear your doubts and make a way to think more in other directions.

You can also follow the link.

You could check the sticky in this section 'Starting C'. I just noticed it today.

DON'T follow Yashwant Kanetkar (as suggested by cse.avinash)...its a popular book in India (and I'm from India, so its a valid suggestion) but its a complete mess...and wrong...and outdated...and non-standard...and i can go on and on...

A better book to follow(for beginners) would be:
A modern approach to C programming by K. N. King

You can also check out the sticky as advised by gerard4143

Happy Learning...:)

DON'T follow Yashwant Kanetkar (as suggested by cse.avinash)...its a popular book in India (and I'm from India, so its a valid suggestion) but its a complete mess...and wrong...and outdated...and non-standard...and i can go on and on...

A better book to follow(for beginners) would be:
A modern approach to C programming by K. N. King

You can also check out the sticky as advised by gerard4143

Happy Learning...:)

I never heard of this book so I check Amazon's reviews - 29/36 reviews 5/5 stars.

http://www.amazon.ca/Programming-Approach-K-N-King/dp/0393969452

"The hidden treasure of c" by Rajiv Dhaneskar

if you are an indian .i would suggest you"c in depth "by Srivastav and Srivastav.dont go for "let's c"..it has very loopholes..this book will help you in learning c step by step.
keep learning.

"Let us c" is the best book....

"Let us c" is the best book....

Wrong.

SORRY it's my mistake...i have not gone through the book
( Lets Us C) and I suggested it.\
I looked it up, many things are written worng in that book.

K.N.King is good book for beginner's.
and you can check the sticky notes, lots of things are there.

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.