Click here to Skip to main content
15,898,134 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Problem while running exe.. Pin
Ashish Chauhan12-Feb-08 1:59
Ashish Chauhan12-Feb-08 1:59 
GeneralRe: Problem while running exe.. Pin
Rajkumar R12-Feb-08 4:03
Rajkumar R12-Feb-08 4:03 
QuestionC++ Questions [modified] Pin
Andy Rama12-Feb-08 0:35
Andy Rama12-Feb-08 0:35 
GeneralRe: C++ Questions Pin
jhwurmbach12-Feb-08 1:30
jhwurmbach12-Feb-08 1:30 
GeneralRe: C++ Questions Pin
Andy Rama12-Feb-08 22:36
Andy Rama12-Feb-08 22:36 
GeneralRe: C++ Questions Pin
Matthew Faithfull12-Feb-08 2:40
Matthew Faithfull12-Feb-08 2:40 
QuestionRe: C++ Questions Pin
Andy Rama12-Feb-08 21:54
Andy Rama12-Feb-08 21:54 
GeneralRe: C++ Questions Pin
Matthew Faithfull12-Feb-08 22:26
Matthew Faithfull12-Feb-08 22:26 
Aniket Salunkhe wrote:
3. Is there any difference in #define MAX 30 & const int max=30;?


Yes. #define MAX 30 just replaces each occurance of MAX in the code with 30 before it's compiled, const int max=30; declares a variable which will exist at runtime. In the first case int* pInt = &MAX; would give a compiler error in the second int* pInt = &max would be fine.

Aniket Salunkhe wrote:
5. How to use free in that case?


I can't honestly remember, it's years since I used calloc in anger. You'll need to either look at the docs or in the MS C Runtime source which ships as an optional install component with Visual Studio. Every memory allocation function e.g. malloc, calloc, has a specific matching from of free and it's especially important to match them up in Debug builds where they get mapped to diagnostic versions of the functions otherwise you'll get spurious leak reports and heap damaged block reports from the allocation tracking that is added to the debug functions. The CRT memory functions are a tangled multilayer mess, especially in Debug builds and it's not easy to track down the causes of problems after they've occured.

Nothing is exactly what it seems but everything with seems can be unpicked.

GeneralRe: C++ Questions Pin
Andy Rama12-Feb-08 22:32
Andy Rama12-Feb-08 22:32 
Generalset left and right Pin
gentleguy11-Feb-08 23:26
gentleguy11-Feb-08 23:26 
QuestionRe: set left and right Pin
CPallini11-Feb-08 23:37
mveCPallini11-Feb-08 23:37 
GeneralRe: set left and right Pin
gentleguy12-Feb-08 0:15
gentleguy12-Feb-08 0:15 
QuestionRe: set left and right Pin
CPallini12-Feb-08 0:26
mveCPallini12-Feb-08 0:26 
GeneralRe: set left and right Pin
gentleguy12-Feb-08 1:04
gentleguy12-Feb-08 1:04 
GeneralRe: set left and right Pin
CPallini12-Feb-08 2:09
mveCPallini12-Feb-08 2:09 
GeneralRe: set left and right Pin
gentleguy12-Feb-08 19:45
gentleguy12-Feb-08 19:45 
QuestionRe: set left and right Pin
CPallini12-Feb-08 21:30
mveCPallini12-Feb-08 21:30 
QuestionHow to automate VC++ builds Pin
cagespear11-Feb-08 23:13
cagespear11-Feb-08 23:13 
AnswerRe: How to automate VC++ builds Pin
Haroon Sarwar12-Feb-08 1:10
Haroon Sarwar12-Feb-08 1:10 
GeneralRe: How to automate VC++ builds Pin
cagespear12-Feb-08 17:25
cagespear12-Feb-08 17:25 
AnswerRe: How to automate VC++ builds Pin
jhwurmbach12-Feb-08 1:35
jhwurmbach12-Feb-08 1:35 
QuestionRe: How to automate VC++ builds Pin
Matthew Faithfull12-Feb-08 4:15
Matthew Faithfull12-Feb-08 4:15 
GeneralRe: How to automate VC++ builds Pin
jhwurmbach12-Feb-08 4:18
jhwurmbach12-Feb-08 4:18 
GeneralRe: How to automate VC++ builds Pin
Matthew Faithfull12-Feb-08 4:22
Matthew Faithfull12-Feb-08 4:22 
GeneralRe: How to automate VC++ builds Pin
jhwurmbach12-Feb-08 4:57
jhwurmbach12-Feb-08 4:57 

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.