DO30I=10,100
which was interpreted as DO 30 I = 10, 100
An amusing bug I saw in Expert C Programming mentioned how somebody once typed e dot instead of a comma, and DO 30 I = 10. 100
ended up interpreted as a simple real assignment: DO30I = 10.1 int *foo;
means "foo is a pointer to int". But that's explained different from how it's written. More clearly, you can say that "foo" is an int. Then, doing int *foo;
foo = 50;
is obviously wrong because "foo" is not an int; however int *foo;
*foo = 50;
is correct. int *foo[50];
means "foo is an array of pointers to int", or "foo[5] is an int". int *foo; //foo is a pointer to int.
&*foo; //the address of the contents of foo
foo; // same as above, but shorter. +-----------+
| +-+ |
| ^ | |
char *foo[10][20];
^ ^ | |
| +---+ |
+---------------+
* foo is
Since C provides very little metaprogramming capabilities, this was the only way to obtain what I wanted: Most (if not all) other testing libraries/frameworks require some boilerplate to start testing (namely: defining your `main` function, which calls all of your tests). Additionally, every time you write a new test, you must remember to add it to your `main` function.
I decided that those two things were bothersome enough, so I wrote a proof of concept that evolved into a large project with tons of useful features beyond that.