C Programming Tutorial for Beginners

freeCodeCamp.org · 19M views · 2018 · 3:46:13

Open on YouTube

C, C++, Rust, Go & systems languagesEducation & learningcourse

Why Stack Overflow recommends it

Stack Overflow users cite it as the tutorial they were following when they hit a confusing compiler result, such as uninitialized variables, pointer address output, or function declaration order.

Recommended by 0 people across 0 different months, 2020 to 2022.

What it is

A 3 hour 46 minute freeCodeCamp course by Mike Dane (Giraffe Academy) that walks through the core of C from setup to file I/O. It covers variables, data types, printf, arrays, functions, control flow, structs, loops, pointers and reading and writing files, with small projects like a calculator and a guessing game.

What people said

Cites Vishal Jain · 2020-01 · Stack Overflow · on “Function below main function block gives error in 1 case but no error in case 2”

I am trying to learn C and was watching this [this video] and had the following query: At 1:40:24 the function is written below the main function block but the code does not throw an error: #include <stdio.h> #include <stdlib.h> int main() { sayHi(); return 0; } void sayHi() { printf("Hello User"); } At 1:52:00 he runs another function he created below the main block but this time an error comes up, which he explicitly states is due to the function being written below the main block. Why does this error not come up in the first case?

Cites lmgesus · 2021-10 · Stack Overflow · on “Why am I getting "uninitialized local variable 'guess' used" even though I'm doing exactly the same thing the teacher is doing?”

I was doing some amateur practicing and ran into this error: #include <stdio.h> int main(){ int answer = 5; int guess; while (guess != answer) { printf("enter a number: "); scanf_s("%d", &guess); } printf("you guessed the correct number which was 5!"); return 0; } It's pretty simple while loop practice but, for some reason it won't work even though I'm doing the exact same thing as the teacher on this video [this video] is telling me to do. I fixed it by just giving int guess a value, like int guess = 0 . But why does that code work in the video but not in my compiler?

Cites TeacherD · 2022-01 · Stack Overflow · on “Understanding hexadecimal output from C pointers”

I ran some C code in CodeBlocks and printed the memory address. The result was a 16 character hexadecimal. This was an exercise in the youtube tutorial on C from freeCodeCamp at 3:14:05. [this video] The youtube presenter came up with an 8 character hexadecimal result. Does this mean I have twice the system ram vs the presenter? My Windows 10 laptop has 32 GB of ram. Edit, I was instructed to post the relevant C code, here it is. int main() { int age = 30; int * pAge = &age; double gpa = 3.4; double * pGpa = &gpa; char grade = 'A'; char * pGrade = &grade; printf("age's memory address: %p\n", &age); return 0; }