Click here to Skip to main content
16,017,275 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Missing pointer between threads Pin
LighthouseJ13-Oct-05 8:19
LighthouseJ13-Oct-05 8:19 
GeneralRe: Missing pointer between threads Pin
André RB13-Oct-05 9:20
André RB13-Oct-05 9:20 
QuestionGlobals and namespace Pin
karmendra_js13-Oct-05 4:14
karmendra_js13-Oct-05 4:14 
AnswerRe: Globals and namespace Pin
Chris Losinger13-Oct-05 5:29
professionalChris Losinger13-Oct-05 5:29 
AnswerRe: Globals and namespace Pin
toxcct13-Oct-05 5:29
toxcct13-Oct-05 5:29 
AnswerRe: Globals and namespace Pin
ddmcr13-Oct-05 5:52
ddmcr13-Oct-05 5:52 
AnswerRe: Globals and namespace Pin
ThatsAlok13-Oct-05 7:35
ThatsAlok13-Oct-05 7:35 
AnswerRe: Globals and namespace Pin
Arman S.13-Oct-05 10:36
Arman S.13-Oct-05 10:36 
Hi,
Yes you can locate global variables in namespaces.
The importance of doing so depends on the specific case.
For example, if you are afraid your var's name could
conflict with another var's name, put yours in a namespace.
Another example, if you have many global variables (hope
you don't) you'd rather put them in a namespace in terms of
'well organization'.
Code:
namespace Globals
{
bool bVar1;
bool bVar2;
// any others...
} // namespace Globals

Now let's use it:

// method 1. (not preferred)
using namespace Globals;
void f()
{
bVar1 = false;
}

// method 2. (less preferred)
using Global::bVar1
void f()
{
bVar1 = false;
}

// method 3. (ok)
void f()
{
Globals::bVar1 = false;
}


QuestionListCtrl Pin
karmendra_js13-Oct-05 4:07
karmendra_js13-Oct-05 4:07 
AnswerRe: ListCtrl Pin
muthuramji13-Oct-05 5:26
muthuramji13-Oct-05 5:26 
GeneralRe: ListCtrl Pin
karmendra_js14-Oct-05 0:00
karmendra_js14-Oct-05 0:00 
GeneralRe: ListCtrl Pin
muthuramji14-Oct-05 6:29
muthuramji14-Oct-05 6:29 
Questionfunction TransmitFile( ) Pin
REU13-Oct-05 2:28
REU13-Oct-05 2:28 
QuestionWho can tell me how to use Serialize Pin
Fired Fish13-Oct-05 1:55
Fired Fish13-Oct-05 1:55 
AnswerRe: Who can tell me how to use Serialize Pin
ThatsAlok13-Oct-05 2:24
ThatsAlok13-Oct-05 2:24 
AnswerRe: Who can tell me how to use Serialize Pin
ddmcr13-Oct-05 2:48
ddmcr13-Oct-05 2:48 
QuestionRe: Who can tell me how to use Serialize Pin
David Crow13-Oct-05 3:33
David Crow13-Oct-05 3:33 
AnswerRe: Who can tell me how to use Serialize Pin
Fired Fish14-Oct-05 1:39
Fired Fish14-Oct-05 1:39 
QuestionHow to get the total sectors for USB flash disk ? Pin
bghuang13-Oct-05 1:46
bghuang13-Oct-05 1:46 
QuestionWrong date from CDateTimeCtl Pin
vikas amin13-Oct-05 1:31
vikas amin13-Oct-05 1:31 
AnswerRe: Wrong date from CDateTimeCtl Pin
The NULL Developer13-Oct-05 1:35
professionalThe NULL Developer13-Oct-05 1:35 
GeneralRe: Wrong date from CDateTimeCtl Pin
ThatsAlok13-Oct-05 7:38
ThatsAlok13-Oct-05 7:38 
GeneralRe: Wrong date from CDateTimeCtl Pin
vikas amin13-Oct-05 20:15
vikas amin13-Oct-05 20:15 
GeneralRe: Wrong date from CDateTimeCtl Pin
ThatsAlok13-Oct-05 20:21
ThatsAlok13-Oct-05 20:21 
GeneralRe: Wrong date from CDateTimeCtl Pin
vikas amin13-Oct-05 21:28
vikas amin13-Oct-05 21:28 

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.