How can we map the enum values to strings in the C programing language? Often times you need to display a C enum as a string, most often when debugging or handling error conditions. Typical techiques involve usually: a) defining an array of strings (the strings being the enum names of course, and the string […]
Month: February 2013
Makefile variables ($@, $< ...)
Ever wondered what the funny-looking vars in the GNU Makefiles are? These two are the most common ones: $@ and @< there are some other are special vars as well. Here’s what these two mean, and you can look up the rest on the GNU Makefile “Automatic Variables” help page: $@ -is the name of the target currently […]
Emacs wrap lines (disable/enable with toggle-truncate-lines)
Wrapping lines in emacs can be a real pain (fe.g. or programmers) or exactly what you want, for example if you’re writing the text of an email. At any rate it’s nice to know how to turn line wrap on and off in emacs – if anything every now and then you’d accidentally press the […]