DPontes / LearnCtheHardWay

Exercises and notes from the book "Learn C the Hard Way", by Zed Shaw

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Learn C the Hard Way

Exercises and notes from the book "Learn C the Hard Way", by Zed Shaw

Ex1: Dust Off That Compiler

Ex3: Formatted Printing

Ex4: Using a Debugger

This exercise requires that the accompanying video is watched

Ex7: Variables and Types

Ex8: If, Else-If, Else

Ex9: While-loop and Boolean Expressions

Ex10: Switch Statements

Ex11: Arrays and Strings

Ex12: Sizes and Arrays

Ex13: For-Loops and Array of Strings

Ex14: Writing and Using Functions

Ex15: Pointers, dreaded pointers

Pointers Lexicon:

  • type *ptr: A pointer of type named ptr
  • *ptr: The value of whatever ptr is pointed at
  • *(ptr + i): The value of whatever ptr is pointed at plus i
  • &thing: The address of thing
  • type *ptr = &thing: A pointer of type named ptr set to the address of thing
  • ptr++: increment to where ptr points

Ex16: Structs and pointers to them

Aditional pointers Lexicon:

  • ptr->elem: Use pointer to struct/union to get elem

Use an -> when you have a pointer to a struct

About

Exercises and notes from the book "Learn C the Hard Way", by Zed Shaw


Languages

Language:C 99.2%Language:Makefile 0.8%