Click here to Skip to main content
15,796,904 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionSOLVED Passing function with parameters as parameter Pin
Vaclav_18-Apr-20 9:38
Vaclav_18-Apr-20 9:38 
AnswerRe: Passing function with parameters as parameter Pin
Greg Utas18-Apr-20 10:07
mveGreg Utas18-Apr-20 10:07 
GeneralRe: Passing function with parameters as parameter Pin
Vaclav_18-Apr-20 10:22
Vaclav_18-Apr-20 10:22 
AnswerRe: Passing function with parameters as parameter Pin
Greg Utas18-Apr-20 11:24
mveGreg Utas18-Apr-20 11:24 
GeneralRe: Passing function with parameters as parameter Pin
Vaclav_18-Apr-20 11:52
Vaclav_18-Apr-20 11:52 
GeneralRe: Passing function with parameters as parameter Pin
Greg Utas18-Apr-20 12:04
mveGreg Utas18-Apr-20 12:04 
GeneralRe: Passing function with parameters as parameter Pin
Vaclav_19-Apr-20 6:47
Vaclav_19-Apr-20 6:47 
GeneralRe: Passing function with parameters as parameter Pin
Greg Utas19-Apr-20 7:05
mveGreg Utas19-Apr-20 7:05 
I believe that this
invalid conversion from ‘int’ to ‘void (*)(int)
means that you are passing an int argument when a function argument is expected, specifically a function that takes one int parameter and returns void.

The problem appears to be
C++
OpenGL_Stencil(OpenGL_Stencil_Circle_Build(6))
where, based on previous posts in this thread, I assume you want OpenGL_Stencil to call OpenGL_Stencil_Circle_Build with a value of 6. If that's the case, you did not read my previous post very carefully, because you need to do it as follows:
OpenGL_Stencil(OpenGL_Stencil_Circle_Build, 6)
where OpenGL_Stencil is defined as
C++
void OpenGL_Stencil(void (*func) (int), int arg)
{
   //...
   func(arg);  // this is the line that will call OpenGL_Stencil_Circle_Build with a value of 6
}

GeneralSOLVED Re: Passing function with parameters as parameter Pin
Vaclav_19-Apr-20 10:03
Vaclav_19-Apr-20 10:03 
AnswerRe: Passing function with parameters as parameter Pin
Richard MacCutchan18-Apr-20 22:21
mveRichard MacCutchan18-Apr-20 22:21 
QuestionMath problem with C code Pin
Vaclav_18-Apr-20 7:47
Vaclav_18-Apr-20 7:47 
AnswerRe: Math problem with C code Pin
k505418-Apr-20 8:00
mvek505418-Apr-20 8:00 
GeneralSOLVED Re: Math problem with C code Pin
Vaclav_18-Apr-20 9:16
Vaclav_18-Apr-20 9:16 
QuestionRe: Math problem with C code Pin
Richard MacCutchan18-Apr-20 8:02
mveRichard MacCutchan18-Apr-20 8:02 
QuestionPass a struct as a function parameter or just use it as a global variable? Pin
Vaclav_18-Apr-20 6:23
Vaclav_18-Apr-20 6:23 
AnswerRe: Pass a struct as a function parameter or just use it as a global variable? Pin
k505418-Apr-20 7:17
mvek505418-Apr-20 7:17 
GeneralRe: Pass a struct as a function parameter or just use it as a global variable? Pin
Vaclav_18-Apr-20 7:30
Vaclav_18-Apr-20 7:30 
Questioncomputational cost of math functions Pin
Calin Negru17-Apr-20 6:06
Calin Negru17-Apr-20 6:06 
AnswerRe: computational cost of math functions Pin
OriginalGriff17-Apr-20 6:10
mvaOriginalGriff17-Apr-20 6:10 
GeneralRe: computational cost of math functions Pin
Calin Negru17-Apr-20 7:58
Calin Negru17-Apr-20 7:58 
GeneralRe: computational cost of math functions Pin
leon de boer17-Apr-20 8:04
leon de boer17-Apr-20 8:04 
GeneralRe: computational cost of math functions Pin
Calin Negru17-Apr-20 9:14
Calin Negru17-Apr-20 9:14 
GeneralRe: computational cost of math functions Pin
Joe Woodbury17-Apr-20 11:43
professionalJoe Woodbury17-Apr-20 11:43 
GeneralRe: computational cost of math functions Pin
kalberts17-Apr-20 12:47
kalberts17-Apr-20 12:47 
GeneralRe: computational cost of math functions Pin
Joe Woodbury17-Apr-20 13:53
professionalJoe Woodbury17-Apr-20 13:53 

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.