PCP – C (Tin Soldier)

Aaron Propp - 2B Computer
Posted on: July 18, 2018

*** The Tin Soldier is intended to be a humorous and entertaining look at issues and events at the University of Waterloo. As such articles should not be taken to represent real events or opinions, and they should not be associated with the University of Waterloo staff or administration in any way. Any similarities to real world events, people or corporations is purely coincidental – or non-coincidental but meant in an entirely joking manner.***

#include <cpython.h>
#include <cython.h>
#include <stdio.h>
#include <stdlib.h>

int main(void) {
printf(“Notice the spacing is slightly off and the compiler isn’t upset.\n”);
/*my apologies it’s an interpreted language.*/
if(language == python) {
printf(“Is python actually a language? It just binds to C anyways.\n”);
} else if (language == C) {
printf(“Who needs these abstractions anyways.\n”);
}
int a = 5;
char* s = “unladen swallow”;
/*have fun debugging this at runtime :-)*/
printf(“This is a string in python: %s\n”, a + c); // C would have caught this
while(program == slow) {
printf(“Wonder if I should have used something closer to metal.\n”);
}
/*You can do a fork bomb.
Not recommended and you will definitely get you banned from university computers.
Please try this only on your own machine. But don’t. It will wreck it.*/
while(1) {
fork();
}
/*Requesting memory from the OS.
Novel concept isn’t it?*/
int* arr = malloc(sizeof(int)*4);
/*Hell you could even write your own OS, embedded system, etc. with C.
Try doing that with python. Let me know how it goes.*/

printf(“Caught the interpreter error yet?\n);

/*Notice how you know what your variable is?
No looking for duck typing errors.*/

free(arr); //My programming instructor would hunt me down if I didn’t do this.
}

There are no comments yet, add one below.

Leave a Comment