Click here to Skip to main content
15,892,737 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionProblem with Imagelist_LoadBitmap Pin
Cold_Fearing_Bird29-May-11 7:26
Cold_Fearing_Bird29-May-11 7:26 
AnswerRe: Problem with Imagelist_LoadBitmap Pin
Niklas L29-May-11 8:39
Niklas L29-May-11 8:39 
QuestionPassing char* to a function and change the argument problem Pin
.jpg29-May-11 6:24
.jpg29-May-11 6:24 
AnswerRe: Passing char* to a function and change the argument problem Pin
CPallini29-May-11 6:38
mveCPallini29-May-11 6:38 
AnswerRe: Passing char* to a function and change the argument problem Pin
Richard MacCutchan29-May-11 13:26
mveRichard MacCutchan29-May-11 13:26 
GeneralRe: Passing char* to a function and change the argument problem Pin
MicroVirus30-May-11 3:37
MicroVirus30-May-11 3:37 
GeneralRe: Passing char* to a function and change the argument problem Pin
Richard MacCutchan30-May-11 4:13
mveRichard MacCutchan30-May-11 4:13 
GeneralRe: Passing char* to a function and change the argument problem Pin
MicroVirus30-May-11 4:39
MicroVirus30-May-11 4:39 
Unfortunately, it has everything to do with your answer and code. Even though the OP is obviously new to C/C++, it doesn't hurt to learn good practices right from the start.
At any rate, it wasn't a suggestion: it's me saying that it is bad practice to use pointers and string literals in that way, for the reasons I explained. This is quite independent of the programmer's intentions.

So my point is: your solution was almost correct, except for that you should use 'const char*' everywhere to work with it like this. This could potentially save the OP lots of time trying to debug weird access violation errors later on, as the compiler will be able to inform you when you are doing something inappropriate that you are allowed to do when just defining it as 'char*'.

Now if you think I am entirely wrong and that it is in fact not poor practice, then I'd love to hear your arguments.
AnswerRe: Passing char* to a function and change the argument problem Pin
«_Superman_»29-May-11 19:30
professional«_Superman_»29-May-11 19:30 
GeneralRe: Passing char* to a function and change the argument problem Pin
Richard MacCutchan29-May-11 22:49
mveRichard MacCutchan29-May-11 22:49 
Questionproblem releasing .exe to vs2008 users Pin
UdiOshi28-May-11 4:49
UdiOshi28-May-11 4:49 
AnswerRe: problem releasing .exe to vs2008 users Pin
barneyman28-May-11 5:17
barneyman28-May-11 5:17 
GeneralRe: problem releasing .exe to vs2008 users Pin
UdiOshi28-May-11 5:20
UdiOshi28-May-11 5:20 
AnswerRe: problem releasing .exe to vs2008 users Pin
«_Superman_»28-May-11 17:31
professional«_Superman_»28-May-11 17:31 
QuestionDoes VS resource compiler support PNG file Pin
Cold_Fearing_Bird28-May-11 2:36
Cold_Fearing_Bird28-May-11 2:36 
AnswerRe: Does VS resource compiler support PNG file Pin
Alain Rist28-May-11 3:36
Alain Rist28-May-11 3:36 
QuestionPointers to member functions which return pointers to themselves Pin
Ray Hagstrom27-May-11 11:08
Ray Hagstrom27-May-11 11:08 
QuestionRe: Pointers to member functions which return pointers to themselves Pin
CPallini28-May-11 3:01
mveCPallini28-May-11 3:01 
AnswerRe: Pointers to member functions which return pointers to themselves Pin
Ray Hagstrom31-May-11 12:40
Ray Hagstrom31-May-11 12:40 
GeneralRe: Pointers to member functions which return pointers to themselves Pin
CPallini31-May-11 21:08
mveCPallini31-May-11 21:08 
AnswerRe: Pointers to member functions which return pointers to themselves Pin
Stefan_Lang30-May-11 4:50
Stefan_Lang30-May-11 4:50 
GeneralRe: Pointers to member functions which return pointers to themselves Pin
Ray Hagstrom31-May-11 12:46
Ray Hagstrom31-May-11 12:46 
GeneralRe: Pointers to member functions which return pointers to themselves Pin
Stefan_Lang31-May-11 21:15
Stefan_Lang31-May-11 21:15 
AnswerRe: Pointers to member functions which return pointers to themselves Pin
saephoed8-Jan-14 11:22
saephoed8-Jan-14 11:22 
QuestionAlphaBlend doesn't work properly Pin
Cold_Fearing_Bird27-May-11 9:06
Cold_Fearing_Bird27-May-11 9:06 

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.