Translation Units

Jan 2, 2014 at 9:47pm
Hey, can somebody please affirm my knowledge of translation units in C? I read they are a source file after being preprocessed, so if I have three files, main.c, stuff.c and stuff.h: stuff.h contains some function declarations, stuff.c #includes stuff.h and defines the functions and main.c #includes stuff.h and calls them, are the translation units in this program: the contents of stuff.h, the contents of stuff.c with stuff.h and the contents of main.c with stuff.h?
Jan 2, 2014 at 9:49pm
As you said, they are source files after being preprocessed.
You have two TUs: one that is main.c after #including stuff.h, and one that is stuff.c after #including stuff.h.
Jan 2, 2014 at 9:50pm
It's the content of the .c files after the .h files have been included.
Jan 2, 2014 at 9:58pm
Oh okay, thankyou very much :)
Topic archived. No new replies allowed.