My brainstorming session:
Fine sorting memory leaks are always enjoyable. Worry with classes, constructors, copy constructors, and destructors, and you should easily create a complex task.
Single errors for array loops are also classic.
Then you can just mess with the minds of readers by playing with the names of things. Create variables with subtly different names, variables with random (and slightly different) names, etc., and then let them try to determine the place where you mixed up length and lenght . Do not forget about the differences in the case.
Call conventions can be used to create subtle errors (for example, changing the order of parameters).
Also, donβt forget about the endless hours of pleasure from complex preprocessor options and templates (did you know that C ++ templates are supposedly filled by Turing?) Metaprogramming errors should be interesting.
The next idea that comes to mind is to provide the right program, but erroneous input (subtle, of course). After that, the program will crash if there is no error checking, but there will be some time until people realize that they are looking for problems in the wrong place.
Race conditions are often difficult to reproduce and fix, try playing with multi-threaded.
Under streams / overflows you can easily skip random checking.
And last but not least, if you are a programmer, try to recall what was the last big problem you spent two weeks solving. If you are not a programmer, try to find it and ask. I am a .NET programmer, so, unfortunately, my impressions have little to do with your C / C ++ requirement.