I have a lot of code files and their respective headers.
And I'm organizing the code this way in the project root folder: All the code files and the "makefile" are at root level, all header files are into a folder called "inc" and I have a special folder called "strings". In this special folder I have header files that contain all the strings used by the code files.
Example:
Code file: error.c
Code: Select all
#include <stdio.h>
#include "inc/error.h"
#include "strings/error_str.h"
void geterror( int errorid)
{
printf(ERRORSTR1,errorid);
}
Code: Select all
#ifndef _ERROR_STR_
#define _ERROR_STR_
#define ERRORSTR1 "Error number %d"
#endif
Edit: The stuff that I'm doing with the strings... I guess that "special" headers for strings are useless, but a friend told me it's better to do this way, the question is: Is this really necessary?