Click here to Skip to main content
15,895,709 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: suggestion..pls Pin
RockyJames29-Jun-06 8:36
RockyJames29-Jun-06 8:36 
GeneralRe: suggestion..pls Pin
Zac Howland29-Jun-06 9:47
Zac Howland29-Jun-06 9:47 
GeneralRe: suggestion..pls Pin
RockyJames29-Jun-06 13:21
RockyJames29-Jun-06 13:21 
GeneralRe: suggestion..pls Pin
Zac Howland29-Jun-06 16:01
Zac Howland29-Jun-06 16:01 
GeneralRe: suggestion..pls Pin
RockyJames29-Jun-06 18:48
RockyJames29-Jun-06 18:48 
QuestionHow to add Image(GDI+) object to CImageList Pin
NoName II29-Jun-06 6:50
NoName II29-Jun-06 6:50 
AnswerRe: How to add Image(GDI+) object to CImageList Pin
PJ Arends29-Jun-06 17:33
professionalPJ Arends29-Jun-06 17:33 
QuestionNeed small explanation about this kind of syntax Pin
JMelsi29-Jun-06 6:12
JMelsi29-Jun-06 6:12 
Hello everyone,

I am working on a code related to binary trees (data structures) and there is a small part of it that I can't undserstand because of its strange syntax.
To make things easier for somebody who may help I abstracted this part of code and made it simple and stand alone but still keeping that strange syntax! Looking the output I know what the code does but I cannot understand its syntax at all. I am giving the code below with questions for the lines I don't understand:

<br />
#include <iostream><br />
#include <string><br />
<br />
using namespace std;<br />
 <br />
//what does this: "void(Visit_) (int *s)" mean, it seems to me like<br />
//casting but the kind of casting I know is e.g: cout << (char)97;<br />
void PreOrder(void(Visit_) (int *s), int *s){<br />
     <br />
//This: "Visit_(s)" is very strange too. I have no idea what<br />
// "Visit_()" is, a variable, an identifer, a function ... etc<br />
   Visit_(s); <br />
}<br />
        <br />
static void Output_(int *t)<br />
  {cout << *t << 'Z';}  <br />
      <br />
           <br />
int main(){<br />
<br />
 <br />
int *p;<br />
int i=5;<br />
<br />
p=&i;<br />
<br />
 //This line is uncommon too, how is it possible to pass the name of <br />
 //a function as a parameter to a function. What are the actions taken <br />
 //in the background for this line<br />
 PreOrder(Output_, p);<br />
<br />
<br />
getchar();<br />
return 0;    <br />
}<br />


I would appreciate it a lot if anyone could explain even a single line, maybe then I can understand the whole image my self.

Thank you all in advance,
Melsi
Confused | :confused:
AnswerRe: Need small explanation about this kind of syntax Pin
Sarath C29-Jun-06 6:32
Sarath C29-Jun-06 6:32 
GeneralRe: Need small explanation about this kind of syntax Pin
Zac Howland29-Jun-06 6:36
Zac Howland29-Jun-06 6:36 
GeneralRe: Need small explanation about this kind of syntax Pin
Sarath C29-Jun-06 6:52
Sarath C29-Jun-06 6:52 
GeneralRe: Need small explanation about this kind of syntax Pin
JMelsi29-Jun-06 7:32
JMelsi29-Jun-06 7:32 
AnswerRe: Need small explanation about this kind of syntax Pin
led mike29-Jun-06 6:34
led mike29-Jun-06 6:34 
GeneralRe: Need small explanation about this kind of syntax Pin
JMelsi30-Jun-06 0:53
JMelsi30-Jun-06 0:53 
Questioniterator Pin
knoxplusplus29-Jun-06 5:54
knoxplusplus29-Jun-06 5:54 
AnswerRe: iterator Pin
Sarath C29-Jun-06 6:01
Sarath C29-Jun-06 6:01 
AnswerRe: iterator Pin
Zac Howland29-Jun-06 6:34
Zac Howland29-Jun-06 6:34 
GeneralRe: iterator [modified] Pin
knoxplusplus29-Jun-06 7:38
knoxplusplus29-Jun-06 7:38 
GeneralRe: iterator Pin
Zac Howland29-Jun-06 8:12
Zac Howland29-Jun-06 8:12 
QuestionScope Pin
Jay0329-Jun-06 5:26
Jay0329-Jun-06 5:26 
AnswerRe: Scope Pin
Chris Losinger29-Jun-06 5:33
professionalChris Losinger29-Jun-06 5:33 
AnswerRe: Scope Pin
Zac Howland29-Jun-06 6:38
Zac Howland29-Jun-06 6:38 
GeneralRe: Scope Pin
Jay0329-Jun-06 7:40
Jay0329-Jun-06 7:40 
GeneralRe: Scope Pin
Blake Miller30-Jun-06 10:25
Blake Miller30-Jun-06 10:25 
QuestionHow to dynamically change a window class name? Pin
yjzh29-Jun-06 5:12
yjzh29-Jun-06 5:12 

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.