Click here to Skip to main content
15,115,557 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: COleVariant to COLORREF Pin
David Crow12-May-17 10:45
MemberDavid Crow12-May-17 10:45 
AnswerRe: COleVariant to COLORREF Pin
_Flaviu13-May-17 22:17
Member_Flaviu13-May-17 22:17 
AnswerRe: COleVariant to COLORREF Pin
_Flaviu14-May-17 21:14
Member_Flaviu14-May-17 21:14 
QuestionArray of char* Pin
Django_Untaken12-May-17 0:54
MemberDjango_Untaken12-May-17 0:54 
AnswerRe: Array of char* Pin
Jochen Arndt12-May-17 1:23
professionalJochen Arndt12-May-17 1:23 
GeneralRe: Array of char* Pin
Django_Untaken12-May-17 2:29
MemberDjango_Untaken12-May-17 2:29 
GeneralRe: Array of char* Pin
Jochen Arndt12-May-17 2:35
professionalJochen Arndt12-May-17 2:35 
GeneralRe: Array of char* Pin
leon de boer14-May-17 17:15
Memberleon de boer14-May-17 17:15 
Only addition to Jochens answer is to remove confusion to you typedef the char* pointer
ptrCount = 2;
typedef char* CHARPTR;
CHARPTR* charPtrArray = (CHARPTR*)malloc(sizeof(CHARPTR)*ptrcount);

Now it looks like any other array

The confusion exists because char** can be a couple of things in C you can't distinguish them without looking at the initialization code
1.) A pointer to a char* (always true)
2.) An array of char* (if initialized as such)
3.) A multidimensional char array (if initialized as such)

Number 3 in particular usually causes mass confusion with students learning C.
The typedef doesn't stop you assuming the wrong thing but it does give you language cues to what it is and is easier to read.
In vino veritas


modified 14-May-17 22:51pm.

AnswerRe: Array of char* Pin
Huzifa Terkawi14-May-17 17:07
MemberHuzifa Terkawi14-May-17 17:07 
AnswerRe: Array of char* Pin
Munchies_Matt17-May-17 23:27
MemberMunchies_Matt17-May-17 23:27 
QuestionRedraw a CStatic,create it using Create,but the function DrawItem doesn't been run Pin
Member 1114733810-May-17 17:24
MemberMember 1114733810-May-17 17:24 
AnswerRe: Redraw a CStatic,create it using Create,but the function DrawItem doesn't been run Pin
Jochen Arndt10-May-17 22:47
professionalJochen Arndt10-May-17 22:47 
Question[solved] Declare & Use Gobal Variable in C (Just like Singleton Variable) Pin
Django_Untaken9-May-17 2:42
MemberDjango_Untaken9-May-17 2:42 
AnswerRe: Declare & Use Gobal Variable in C (Just like Singleton Variable) Pin
Jochen Arndt9-May-17 3:32
professionalJochen Arndt9-May-17 3:32 
GeneralRe: Declare & Use Gobal Variable in C (Just like Singleton Variable) Pin
Django_Untaken9-May-17 4:10
MemberDjango_Untaken9-May-17 4:10 
AnswerRe: Declare & Use Gobal Variable in C (Just like Singleton Variable) Pin
Jochen Arndt9-May-17 4:15
professionalJochen Arndt9-May-17 4:15 
AnswerRe: [solved] Declare & Use Gobal Variable in C (Just like Singleton Variable) Pin
Richard MacCutchan9-May-17 5:49
mveRichard MacCutchan9-May-17 5:49 
AnswerRe: [solved] Declare & Use Gobal Variable in C (Just like Singleton Variable) Pin
Rick York12-May-17 8:19
mveRick York12-May-17 8:19 
QuestionCTreeCtrl with CustomDraw Flickering Pin
SamwisePl5-May-17 1:29
MemberSamwisePl5-May-17 1:29 
AnswerRe: CTreeCtrl with CustomDraw Flickering Pin
Richard MacCutchan5-May-17 1:58
mveRichard MacCutchan5-May-17 1:58 
GeneralRe: CTreeCtrl with CustomDraw Flickering Pin
SamwisePl5-May-17 2:17
MemberSamwisePl5-May-17 2:17 
GeneralRe: CTreeCtrl with CustomDraw Flickering Pin
Richard MacCutchan5-May-17 2:48
mveRichard MacCutchan5-May-17 2:48 
AnswerRe: CTreeCtrl with CustomDraw Flickering Pin
Victor Nijegorodov5-May-17 7:00
MemberVictor Nijegorodov5-May-17 7:00 
GeneralRe: CTreeCtrl with CustomDraw Flickering Pin
SamwisePl7-May-17 20:46
MemberSamwisePl7-May-17 20:46 
AnswerRe: CTreeCtrl with CustomDraw Flickering Pin
leon de boer7-May-17 4:18
Memberleon de boer7-May-17 4:18 

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.