Click here to Skip to main content
15,914,642 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Buffer Size Pin
John R. Shaw14-Mar-07 14:55
John R. Shaw14-Mar-07 14:55 
AnswerRe: Buffer Size Pin
James R. Twine12-Mar-07 2:22
James R. Twine12-Mar-07 2:22 
GeneralRe: Buffer Size Pin
John R. Shaw12-Mar-07 2:31
John R. Shaw12-Mar-07 2:31 
GeneralRe: Buffer Size Pin
James R. Twine12-Mar-07 2:46
James R. Twine12-Mar-07 2:46 
GeneralRe: Buffer Size Pin
John R. Shaw12-Mar-07 3:08
John R. Shaw12-Mar-07 3:08 
GeneralRe: Buffer Size Pin
James R. Twine12-Mar-07 3:35
James R. Twine12-Mar-07 3:35 
GeneralRe: Buffer Size Pin
John R. Shaw12-Mar-07 4:37
John R. Shaw12-Mar-07 4:37 
AnswerRe: Buffer Size Pin
Stephen Hewitt12-Mar-07 13:18
Stephen Hewitt12-Mar-07 13:18 
On a side note, why use macros when enums will work just as well? Better in fact. For example try doing this with macros:
void Function1()
{
	enum { buffersize = 1024 };
 
	char buffer[buffersize];
}
 

void Function2()
{
	enum { buffersize = 2048 };
 

	char buffer[buffersize];
}


The problem with macros in this context is that they don’t obey C/C++ scoping rules. Using macros to define constants is old fashioned and should be avoided.


Steve

QuestionListing hidden dir's Pin
sheetal_0611-Mar-07 20:30
sheetal_0611-Mar-07 20:30 
AnswerRe: Listing hidden dir's Pin
prasad_som11-Mar-07 21:17
prasad_som11-Mar-07 21:17 
QuestionRe: Listing hidden dir's Pin
David Crow12-Mar-07 4:34
David Crow12-Mar-07 4:34 
AnswerRe: Listing hidden dir's Pin
Hamid_RT12-Mar-07 5:37
Hamid_RT12-Mar-07 5:37 
QuestionNeed to display file open dialog in the center of the screen Pin
amitmistry_petlad 11-Mar-07 20:09
amitmistry_petlad 11-Mar-07 20:09 
AnswerRe: Need to display file open dialog in the center of the screen Pin
prasad_som11-Mar-07 20:15
prasad_som11-Mar-07 20:15 
GeneralRe: Need to display file open dialog in the center of the screen Pin
amitmistry_petlad 11-Mar-07 20:18
amitmistry_petlad 11-Mar-07 20:18 
AnswerRe: Need to display file open dialog in the center of the screen Pin
prasad_som11-Mar-07 20:35
prasad_som11-Mar-07 20:35 
GeneralRe: Need to display file open dialog in the center of the screen Pin
amitmistry_petlad 11-Mar-07 19:42
amitmistry_petlad 11-Mar-07 19:42 
AnswerRe: Need to display file open dialog in the center of the screen Pin
prasad_som11-Mar-07 20:57
prasad_som11-Mar-07 20:57 
GeneralRe: Need to display file open dialog in the center of the screen Pin
John R. Shaw11-Mar-07 20:57
John R. Shaw11-Mar-07 20:57 
GeneralRe: Need to display file open dialog in the center of the screen Pin
prasad_som11-Mar-07 21:02
prasad_som11-Mar-07 21:02 
GeneralRe: Need to display file open dialog in the center of the screen Pin
John R. Shaw11-Mar-07 21:50
John R. Shaw11-Mar-07 21:50 
GeneralRe: Need to display file open dialog in the center of the screen Pin
prasad_som11-Mar-07 22:56
prasad_som11-Mar-07 22:56 
GeneralRe: Need to display file open dialog in the center of the screen Pin
John R. Shaw12-Mar-07 0:08
John R. Shaw12-Mar-07 0:08 
GeneralRe: Need to display file open dialog in the center of the screen Pin
prasad_som12-Mar-07 0:20
prasad_som12-Mar-07 0:20 
GeneralRe: Need to display file open dialog in the center of the screen Pin
John R. Shaw12-Mar-07 1:36
John R. Shaw12-Mar-07 1:36 

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.