Summary of "Learn to program with c - Part 4 - Types"

Purpose and repository

Getting the example code

  1. Clone the repository: git clone <repository URL> # e.g. github.com/<username>/c_tutorial

  2. Change into the episode directory: cd c_tutorial/episode_04/types

  3. Update later with: git pull

  4. Build the example programs (a simple Makefile is included): make

  5. Run an example and page the output: ./hello_types | less

printf and format strings — how they work

Examples:

printf("%d\n", 5);            // prints integer 5
printf("%f\n", 3.14);         // prints floating-point number
printf("%s %s\n", "a", "b");  // prints two strings separated by space
printf("%c\n", 'a');          // prints character 'a'
printf("%c%c%c\n", 97,98,99); // prints "abc" because 97 == 'a' in ASCII

C primitive types and important notes

char

short

int

long and long long

Floating-point types

_Bool / bool

Other types mentioned (not covered in detail)

Example programs and tools in the repo

Key takeaways / lessons

Practical exercises suggested

Speakers / sources featured

Category ?

Educational


Share this summary


Is the summary off?

If you think the summary is inaccurate, you can reprocess it with the latest model.

Video