Click here to Skip to main content
15,902,114 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: About Memory initialization Pin
jhwurmbach7-Nov-07 0:35
jhwurmbach7-Nov-07 0:35 
GeneralRe: About Memory initialization Pin
Nemanja Trifunovic7-Nov-07 3:48
Nemanja Trifunovic7-Nov-07 3:48 
GeneralRe: About Memory initialization Pin
jhwurmbach7-Nov-07 3:52
jhwurmbach7-Nov-07 3:52 
GeneralRe: About Memory initialization Pin
Nemanja Trifunovic7-Nov-07 4:17
Nemanja Trifunovic7-Nov-07 4:17 
GeneralRe: About Memory initialization Pin
Matthew Faithfull6-Nov-07 23:58
Matthew Faithfull6-Nov-07 23:58 
GeneralRe: About Memory initialization Pin
toxcct7-Nov-07 0:13
toxcct7-Nov-07 0:13 
AnswerRe: About Memory initialization Pin
toxcct7-Nov-07 0:08
toxcct7-Nov-07 0:08 
AnswerRe: About Memory initialization Pin
John R. Shaw7-Nov-07 0:56
John R. Shaw7-Nov-07 0:56 
Ahaaa! Use STL instead!

Seriously use the STL, unless you have a good reason not too. The little code line you showed is equivalent to “char* str = (char*)malloc(n)” in C code. Use std::string instead of that and ignore the internal details (life gets complicated there).

I love C, but you have to learn to separate the concepts that apply to C from those that apply to C++.

If you use the STL liberally, then you will rarely need to allocate memory directly.


INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra

QuestionHow to make a connection to MySQL in MFC? Pin
TooShy2Talk6-Nov-07 23:15
TooShy2Talk6-Nov-07 23:15 
QuestionRe: How to make a connection to MySQL in MFC? Pin
David Crow7-Nov-07 4:37
David Crow7-Nov-07 4:37 
AnswerRe: How to make a connection to MySQL in MFC? Pin
TooShy2Talk7-Nov-07 14:37
TooShy2Talk7-Nov-07 14:37 
QuestionRe: How to make a connection to MySQL in MFC? Pin
David Crow8-Nov-07 2:41
David Crow8-Nov-07 2:41 
QuestionDYNCALL(writeData)((UCHAR *) Pin
doc606-Nov-07 22:59
doc606-Nov-07 22:59 
AnswerRe: DYNCALL(writeData)((UCHAR *) Pin
Matthew Faithfull6-Nov-07 23:08
Matthew Faithfull6-Nov-07 23:08 
GeneralCompilation on dual-core Pin
hairy_hats6-Nov-07 22:37
hairy_hats6-Nov-07 22:37 
GeneralRe: Compilation on dual-core Pin
Matthew Faithfull6-Nov-07 23:00
Matthew Faithfull6-Nov-07 23:00 
GeneralRe: Compilation on dual-core Pin
hairy_hats6-Nov-07 23:04
hairy_hats6-Nov-07 23:04 
GeneralRe: Compilation on dual-core Pin
Matthew Faithfull6-Nov-07 23:15
Matthew Faithfull6-Nov-07 23:15 
QuestionRe: Compilation on dual-core Pin
David Crow7-Nov-07 4:40
David Crow7-Nov-07 4:40 
AnswerRe: Compilation on dual-core Pin
hairy_hats7-Nov-07 4:43
hairy_hats7-Nov-07 4:43 
QuestionAnother CAsyncSocket Problem Pin
TheInfernalCrow6-Nov-07 22:04
TheInfernalCrow6-Nov-07 22:04 
GeneralRe: Another CAsyncSocket Problem Pin
Matthew Faithfull6-Nov-07 22:45
Matthew Faithfull6-Nov-07 22:45 
GeneralRe: Another CAsyncSocket Problem Pin
TheInfernalCrow7-Nov-07 1:40
TheInfernalCrow7-Nov-07 1:40 
AnswerRe: Another CAsyncSocket Problem Pin
Mark Salsbery7-Nov-07 7:37
Mark Salsbery7-Nov-07 7:37 
GeneralRe: Another CAsyncSocket Problem Pin
TheInfernalCrow7-Nov-07 19:25
TheInfernalCrow7-Nov-07 19:25 

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.