Click here to Skip to main content
15,915,319 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Telnet, FTP and smtp server Pin
bigjoe11a15-Jan-08 8:14
bigjoe11a15-Jan-08 8:14 
Questionhow can i accept input without using command button? Pin
belle12-Jan-08 16:22
belle12-Jan-08 16:22 
AnswerRe: how can i accept input without using command button? Pin
David Crow12-Jan-08 16:48
David Crow12-Jan-08 16:48 
GeneralRe: how can i accept input without using command button? Pin
CPallini13-Jan-08 2:23
mveCPallini13-Jan-08 2:23 
AnswerRe: how can i accept input without using command button? Pin
gggwb13-Jan-08 5:08
gggwb13-Jan-08 5:08 
AnswerRe: how can i accept input without using command button? Pin
Iain Clarke, Warrior Programmer14-Jan-08 3:43
Iain Clarke, Warrior Programmer14-Jan-08 3:43 
GeneralDefining Global Constants Pin
Leslie Sanford12-Jan-08 14:01
Leslie Sanford12-Jan-08 14:01 
GeneralRe: Defining Global Constants Pin
Mark Salsbery12-Jan-08 14:37
Mark Salsbery12-Jan-08 14:37 
Leslie Sanford wrote:
Unfortunately, that means that this:

extern const int BufferSize;

Doesn't work.


Why not?

You can have this in a header file so any module that needs it
knows it exists somewhere...
extern const int BufferSize;

and you need the instance in exactly ONE (CPP) module...
const int BufferSize = 16384;


Your alternative method is nice because it's wrapped in a class,
which will help prevent future name collisions. You could use the global
variable in a different namespace as well.

Mark

Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

GeneralRe: Defining Global Constants Pin
Leslie Sanford12-Jan-08 14:56
Leslie Sanford12-Jan-08 14:56 
GeneralRe: Defining Global Constants Pin
CPallini13-Jan-08 2:10
mveCPallini13-Jan-08 2:10 
GeneralRe: Defining Global Constants Pin
Leslie Sanford13-Jan-08 4:43
Leslie Sanford13-Jan-08 4:43 
GeneralRe: Defining Global Constants Pin
Mark Salsbery13-Jan-08 8:09
Mark Salsbery13-Jan-08 8:09 
GeneralRe: Defining Global Constants Pin
CPallini13-Jan-08 8:36
mveCPallini13-Jan-08 8:36 
GeneralRe: Defining Global Constants Pin
Leslie Sanford13-Jan-08 9:21
Leslie Sanford13-Jan-08 9:21 
QuestionRe: Defining Global Constants Pin
David Crow12-Jan-08 16:52
David Crow12-Jan-08 16:52 
GeneralRe: Defining Global Constants Pin
Member 75496012-Jan-08 17:27
Member 75496012-Jan-08 17:27 
GeneralRe: Defining Global Constants Pin
Leslie Sanford12-Jan-08 18:14
Leslie Sanford12-Jan-08 18:14 
GeneralRe: Defining Global Constants Pin
Member 75496013-Jan-08 5:53
Member 75496013-Jan-08 5:53 
GeneralRe: Defining Global Constants Pin
Maxwell Chen12-Jan-08 18:03
Maxwell Chen12-Jan-08 18:03 
GeneralRe: Defining Global Constants Pin
Leslie Sanford12-Jan-08 18:13
Leslie Sanford12-Jan-08 18:13 
GeneralRe: Defining Global Constants [modified] Pin
Maxwell Chen13-Jan-08 7:08
Maxwell Chen13-Jan-08 7:08 
GeneralRe: Defining Global Constants Pin
Member 75496013-Jan-08 10:40
Member 75496013-Jan-08 10:40 
GeneralRe: Defining Global Constants Pin
CPallini13-Jan-08 10:51
mveCPallini13-Jan-08 10:51 
GeneralRe: Defining Global Constants Pin
Member 75496013-Jan-08 17:18
Member 75496013-Jan-08 17:18 
GeneralRe: Defining Global Constants Pin
Maxwell Chen13-Jan-08 18:13
Maxwell Chen13-Jan-08 18:13 

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.