Related Setup: https://gist.github.com/hofmannsven/6814278
Related Pro Tips: https://ochronus.com/git-tips-from-the-trenches/
Related Setup: https://gist.github.com/hofmannsven/6814278
Related Pro Tips: https://ochronus.com/git-tips-from-the-trenches/
Today I'm going to demonstrate the concept of modular programming in C. Together, we'll build a simple integer arithmetic calculator. By the end of this, you'll have an idea of how to do modular programming in C with the use of header files, library files, include guards, and Makefile.
Our program will function like this:
$ ./calculator 1 + 1
2
#!/usr/bin/env bash | |
set -Eeuo pipefail | |
trap cleanup SIGINT SIGTERM ERR EXIT | |
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P) | |
usage() { | |
cat <<EOF | |
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...] |
MIT License | |
Copyright (c) 2021 Daniel Ethridge | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
2021-11-18T15:40:26.3980033Z Found online and idle hosted runner in the current repository's organization account that matches the required labels: 'ubuntu-latest' | |
2021-11-18T15:40:26.5174874Z Waiting for a Hosted runner in the 'organization' to pick this job... | |
2021-11-18T15:40:27.2563899Z Job is waiting for a hosted runner to come online. | |
2021-11-18T15:40:32.3192971Z Job is about to start running on the hosted runner: GitHub Actions 3 (hosted) | |
2021-11-18T15:40:36.8984143Z Current runner version: '2.284.0' | |
2021-11-18T15:40:36.9018415Z ##[group]Operating System | |
2021-11-18T15:40:36.9019528Z Ubuntu | |
2021-11-18T15:40:36.9020004Z 20.04.3 | |
2021-11-18T15:40:36.9020514Z LTS | |
2021-11-18T15:40:36.9021010Z ##[endgroup] |