comp.lang.c
[Top] [All Lists]

best way to manage the headers..

Subject: best way to manage the headers..
From: broli
Date: Fri, 28 Mar 2008 09:23:21 -0700 PDT
Newsgroups: comp.lang.c

In my project it is getting really messy to take care of all the
headers..for eg. right now I have following modules in my project -

vector.c
vector.h
test.c
reader.h
reader.c

vector.h

#ifndef VECTOR_H
#define VECTOR_H

#include <math.h>
....
.....

vector.c

#include "vector.h"
.......................

reader.h

#ifndef READER_H
#define READER_H

#include <stdio.h>
#include <stdlib.h>
.........................
..........................

And then, I have test.c which needs reader.h, vector.h. But there can
be instances where I may need to include stdio.h and stdlib.h but not
other contents of reader.h.  also, it is getting extremely confusing
to manage all the files. So is it a good idea to have a single all.h
file ? My code must be around 7000 lines.

<Prev in Thread] Current Thread [Next in Thread>
Privacy Policy