Click here to Skip to main content
15,890,882 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Problem in Reading File. Pin
Cedric Moonen15-Jul-10 20:57
Cedric Moonen15-Jul-10 20:57 
GeneralRe: Problem in Reading File. Pin
Le@rner15-Jul-10 20:58
Le@rner15-Jul-10 20:58 
GeneralRe: Problem in Reading File. Pin
Cedric Moonen15-Jul-10 21:13
Cedric Moonen15-Jul-10 21:13 
AnswerRe: Problem in Reading File. Pin
SnowHow16-Jul-10 7:18
SnowHow16-Jul-10 7:18 
GeneralRe: Problem in Reading File. Pin
Shivanand Gupta19-Jul-10 0:10
Shivanand Gupta19-Jul-10 0:10 
QuestionMouse Move Capture Pin
shiv@nand15-Jul-10 19:23
shiv@nand15-Jul-10 19:23 
AnswerRe: Mouse Move Capture Pin
KarstenK15-Jul-10 22:04
mveKarstenK15-Jul-10 22:04 
QuestionProper #include sequence Pin
Trevor Johansen15-Jul-10 15:21
Trevor Johansen15-Jul-10 15:21 
I am working on a very large project and would like to know if their is a rule of thumb for the proper sequence for doing #includes.

I have always put my #include's in headers and done no #includes in any of my .cpp files. When my projects get large and I use a lot of the same included files I put a master header and include it in every other header.

For example:

Utils.h
#include <io.h>
#include <pgmspace.h>
#include <delay.h>

-Other helper functions that are 
useful such as a custom printf()


Display.h
#include "Utils.h"
#include "ctime.h"


Display.cpp
#include Display.h


The reason I am asking is my target is VERY memory limited and I need to get things as small as possible so useless inclusions that and bulk I need to get rid of. My other method of doing things is to only include exactly what that .h/.cpp set requires and use a Globals.h with external decelerations for all cross file variables and definitions.

I still do not understand how the linker pieces objects together when their are unused functions. I would imagine that the compiler runs through your code and only generates asm for the functions and variables you use. If their is a function that uses a 10x32bit array but your not using it the compiler skips it? Then in the linker stage if it notices their are duplicate functions in each of the objects it strips out the others and only includes one? If this is the case then my above question is just semantics and I should not worry and do what is easiest to maintain and cleanest.
AnswerRe: Proper #include sequence Pin
coder21k15-Jul-10 19:28
coder21k15-Jul-10 19:28 
GeneralRe: Proper #include sequence Pin
Trevor Johansen15-Jul-10 19:54
Trevor Johansen15-Jul-10 19:54 
AnswerRe: Proper #include sequence Pin
Aescleal15-Jul-10 21:23
Aescleal15-Jul-10 21:23 
GeneralRe: Proper #include sequence Pin
Trevor Johansen16-Jul-10 21:13
Trevor Johansen16-Jul-10 21:13 
QuestionAllocating memory Pin
ALLERSLIT15-Jul-10 6:31
ALLERSLIT15-Jul-10 6:31 
AnswerRe: Allocating memory Pin
Emilio Garavaglia15-Jul-10 7:24
Emilio Garavaglia15-Jul-10 7:24 
AnswerRe: Allocating memory Pin
elchupathingy15-Jul-10 8:34
elchupathingy15-Jul-10 8:34 
AnswerRe: Allocating memory Pin
Richard MacCutchan15-Jul-10 8:56
mveRichard MacCutchan15-Jul-10 8:56 
GeneralRe: Allocating memory Pin
ALLERSLIT15-Jul-10 13:59
ALLERSLIT15-Jul-10 13:59 
QuestionFind the installed version of MS Word Pin
sashoalm15-Jul-10 4:12
sashoalm15-Jul-10 4:12 
AnswerRe: Find the installed version of MS Word Pin
Code-o-mat15-Jul-10 5:45
Code-o-mat15-Jul-10 5:45 
AnswerRe: Find the installed version of MS Word Pin
Richard MacCutchan15-Jul-10 5:58
mveRichard MacCutchan15-Jul-10 5:58 
AnswerRe: Find the installed version of MS Word Pin
Cool_Dev15-Jul-10 18:44
Cool_Dev15-Jul-10 18:44 
GeneralRe: Find the installed version of MS Word [modified] Pin
enhzflep15-Jul-10 21:39
enhzflep15-Jul-10 21:39 
GeneralRe: Find the installed version of MS Word Pin
sashoalm15-Jul-10 22:16
sashoalm15-Jul-10 22:16 
GeneralRe: Find the installed version of MS Word [modified] Pin
Cool_Dev16-Jul-10 2:22
Cool_Dev16-Jul-10 2:22 
QuestionCreateFile - " file is being used by another process." [modified] Pin
Cvaji15-Jul-10 2:31
Cvaji15-Jul-10 2:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.