[sdiy] OT (but very synthy): C question

Tim Daugard daugard at cox.net
Tue Mar 29 15:18:30 CEST 2011


>> Use inclusion guards
>> In one file (MIDI.h)
>>  #ifndef MIDI_H
>>   #define MIDI_H
>>    #ifndef LFO_H
>>    #include "LFO.h"
>>    #endif
>> ...
>> #endif

> You don't need the inner inclusion guards, the outer per-file ones are
> sufficient.

I use the outer ones as the standard process this file once.

The inner ones (when used are to grab things that I know have to be
 grabbed to make this file work.


> To Tom:
> Perhaps a more valuable answer would go along the lines of "a good
> intro book to C is ...." although its been so long since I trod that
> path that I can't personally recommend any introductory books myself,
> although I can recommend Harbison and Steele as a good read.

I had the same problems with recommending books. I have about at least
 six C and C++ books and I still go online to find information. K&R is
 as good as any (for C) I use teach yourself C++ from SAMS mostly, but
 I don't think it's that good. I haven't found anything good for embedded C.

Tim Daugard
AG4GZ 30.4078N 86.6227W Alt: 12 feet above MSL
http://members.cox.net/synthfred/h_toctop.htm (Fred's online edition)





More information about the Synth-diy mailing list