Click here to Skip to main content
15,910,411 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to convert Chinese Unicode string to ANSI multibyte? Pin
Richard MacCutchan23-Mar-10 0:28
mveRichard MacCutchan23-Mar-10 0:28 
GeneralRe: How to convert Chinese Unicode string to ANSI multibyte? Pin
tmx24-Mar-10 21:47
tmx24-Mar-10 21:47 
QuestionReg MDI windows Explorer Pin
hellogany22-Mar-10 20:45
hellogany22-Mar-10 20:45 
AnswerRe: Reg MDI windows Explorer Pin
Richard MacCutchan22-Mar-10 22:16
mveRichard MacCutchan22-Mar-10 22:16 
AnswerRe: Reg MDI windows Explorer Pin
Adam Roderick J23-Mar-10 2:19
Adam Roderick J23-Mar-10 2:19 
GeneralRe: Reg MDI windows Explorer Pin
hellogany23-Mar-10 18:40
hellogany23-Mar-10 18:40 
GeneralRe: Reg MDI windows Explorer Pin
hellogany28-Mar-10 20:15
hellogany28-Mar-10 20:15 
QuestionGCC Linker and Where To Define Structures Pin
Trevor Johansen22-Mar-10 17:46
Trevor Johansen22-Mar-10 17:46 
I am unsure If I am using my #include directives correctly and where to define my structures.

I have many files that are project independent, a .c and .h and when I want the features I have written in my main.c I #include feature.h as normal. What I wonder is I declare all of the includes that feature needs in its header and sometimes I have another include of the same file in another feature.h as well as my main.c

I know that the compiler is invoked for every separate c file so it will include say function _delay() in every .c file. The linker then puts all the objects together and makes the binary but does it strip the duplicate _delays?? I know the pragma once and other inclusion guards are only relative to that source file being compiled and each source will include the functions.

Along the same lines I have a enum states{Info = 0, Speed = 1}; declared in my header and want to use these states in multiple source files so I include the header when I need it. I also have an initialized structure struct branch the_table[8][5] = { {Control,0,0,0,0,0}, {Speed,0,0,0,0,0} }; and since this structure is using memory I must put it in my source file the problem is I want to be able to access this array outside of its source file and if I declare extern truct branch the_table[8][5]; in the header with the rest of the structure decelerations other source files cannot access its internal structure.

Can someone give some insight onto multiple inclusions upon linking and how to properly declare previously defined structures?
AnswerRe: GCC Linker and Where To Define Structures Pin
CPallini22-Mar-10 21:55
mveCPallini22-Mar-10 21:55 
GeneralRe: GCC Linker and Where To Define Structures Pin
Trevor Johansen24-Mar-10 9:22
Trevor Johansen24-Mar-10 9:22 
GeneralRe: GCC Linker and Where To Define Structures Pin
CPallini24-Mar-10 11:33
mveCPallini24-Mar-10 11:33 
GeneralRe: GCC Linker and Where To Define Structures Pin
Trevor Johansen25-Mar-10 13:08
Trevor Johansen25-Mar-10 13:08 
GeneralRe: GCC Linker and Where To Define Structures Pin
CPallini25-Mar-10 21:41
mveCPallini25-Mar-10 21:41 
QuestionHow do you display a bitmap in IE and control navigation? Pin
nstein222-Mar-10 11:57
nstein222-Mar-10 11:57 
AnswerRe: How do you display a bitmap in IE and control navigation? Pin
KarstenK23-Mar-10 4:21
mveKarstenK23-Mar-10 4:21 
QuestionDeleting a single point from a quadtree Pin
Chidori-chan22-Mar-10 9:43
Chidori-chan22-Mar-10 9:43 
AnswerRe: Deleting a single point from a quadtree Pin
Avi Berger22-Mar-10 11:00
Avi Berger22-Mar-10 11:00 
AnswerRe: Deleting a single point from a quadtree Pin
Richard MacCutchan22-Mar-10 11:07
mveRichard MacCutchan22-Mar-10 11:07 
QuestionRe: Deleting a single point from a quadtree Pin
Chidori-chan23-Mar-10 8:52
Chidori-chan23-Mar-10 8:52 
QuestionRST Template Matching Pin
cherrymotion22-Mar-10 6:20
cherrymotion22-Mar-10 6:20 
AnswerRe: RST Template Matching Pin
Tim Craig22-Mar-10 9:45
Tim Craig22-Mar-10 9:45 
GeneralRe: RST Template Matching Pin
cherrymotion22-Mar-10 11:05
cherrymotion22-Mar-10 11:05 
GeneralRe: RST Template Matching Pin
Tim Craig22-Mar-10 13:48
Tim Craig22-Mar-10 13:48 
GeneralRe: RST Template Matching Pin
cherrymotion23-Mar-10 11:18
cherrymotion23-Mar-10 11:18 
GeneralRe: RST Template Matching Pin
Tim Craig23-Mar-10 12:53
Tim Craig23-Mar-10 12:53 

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.