Skip to content

HenryHell0/c_single_file

Repository files navigation

c_single_file

This is a little collection of C files I've written to learn different features and computer architecture.

  • filter_function_any_type.c - This file implements a generic filter function in C that works with any data type using void* and manual memory management. Its like functional programming!!
  • array with multiple data types using enum and unions.c - this implements an array with multiple types of data using unions - I wrote this when I first learned about unions
  • fibonacci_timing.c - I took a computer class for fun and there was an assignment to do a fibonacci sequence. Apparently we were supposed to do it in python so I turned this one into a thing to time different approaches
  • pointer arithmetic.c - some basic pointer arithmetic
  • struct stuff.c - messing around with structs
  • unions - int and char[] sharing memory - endian stuff.c - I learnt about unions so I started using them to mess around with 4 byte ints, and 4 byte char*s.
  • I have also made a few mini games like snake a pong using SDL

do this

  • gcc -o main.exe {file} && ./main.exe && rm main.exe
  • I have MSYS and WSL configured strangely so who knows if it'll run on your machine

🛠 Written by Henry Holton
henryhell0

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages