Skip to content
/ tryingC Public

Collection of small projects written in c lang

Notifications You must be signed in to change notification settings

qois51/tryingC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Things i make while learning C

BEWARE ⚠️⚠️ Broken English Ahead

They said that, the best way to learn something is by apply it irl. So i decide, the best way to learn C is by making something. The hope is that, during the process i learn new things about C and then after made many things, i can master the fundamentals of C.

List of things i made :

Calculate the day of the week

  • About : Program to calculate the day of the week from any date that user input.
  • Point of Interest : i learn something call "mapping value to dictionary"-ish. It basically made if-statement more programmatic?
  • Things i learn :
    • Get array length using 'sizeof'. To get array length by divide array's (as whole) bytes, with the first item in array's byte.
    • You need 'strcmp' to compare two strings. If strcmp return '0', that means the strings is same.
    • There is something called "pointer" in C, i'm still confused about this.
    • Strings are char but in an array form.
  • To Run it :
    $ make project=DayOfWeekFromDate
    $ ./DayOfWeekFromDate
    
  • Reference :

Convert digit to binary and vice versa

Debug Mode

To Debug something, run this command :

$ make project=<Project name here> debug=y

It will take you into gdb environment?, type 'quit' to exit.