Click here to Skip to main content
14,660,354 members
Home » Discussions » C / C++ / MFC
   

C / C++ / MFC

 
QuestionSOLVED Passing function with parameters as parameter Pin
Vaclav_18-Apr-20 8:38
MemberVaclav_18-Apr-20 8:38 
AnswerRe: Passing function with parameters as parameter Pin
Greg Utas18-Apr-20 9:07
professionalGreg Utas18-Apr-20 9:07 
GeneralRe: Passing function with parameters as parameter Pin
Vaclav_18-Apr-20 9:22
MemberVaclav_18-Apr-20 9:22 
AnswerRe: Passing function with parameters as parameter Pin
Greg Utas18-Apr-20 10:24
professionalGreg Utas18-Apr-20 10:24 
GeneralRe: Passing function with parameters as parameter Pin
Vaclav_18-Apr-20 10:52
MemberVaclav_18-Apr-20 10:52 
GeneralRe: Passing function with parameters as parameter Pin
Greg Utas18-Apr-20 11:04
professionalGreg Utas18-Apr-20 11:04 
GeneralRe: Passing function with parameters as parameter Pin
Vaclav_19-Apr-20 5:47
MemberVaclav_19-Apr-20 5:47 
GeneralRe: Passing function with parameters as parameter Pin
Greg Utas19-Apr-20 6:05
professionalGreg Utas19-Apr-20 6: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
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
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 9:03
MemberVaclav_19-Apr-20 9:03 
AnswerRe: Passing function with parameters as parameter Pin
Richard MacCutchan18-Apr-20 21:21
mveRichard MacCutchan18-Apr-20 21:21 
QuestionMath problem with C code Pin
Vaclav_18-Apr-20 6:47
MemberVaclav_18-Apr-20 6:47 
AnswerRe: Math problem with C code Pin
k505418-Apr-20 7:00
mvek505418-Apr-20 7:00 
GeneralSOLVED Re: Math problem with C code Pin
Vaclav_18-Apr-20 8:16
MemberVaclav_18-Apr-20 8:16 
QuestionRe: Math problem with C code Pin
Richard MacCutchan18-Apr-20 7:02
mveRichard MacCutchan18-Apr-20 7:02 
QuestionPass a struct as a function parameter or just use it as a global variable? Pin
Vaclav_18-Apr-20 5:23
MemberVaclav_18-Apr-20 5:23 
AnswerRe: Pass a struct as a function parameter or just use it as a global variable? Pin
k505418-Apr-20 6:17
mvek505418-Apr-20 6:17 
GeneralRe: Pass a struct as a function parameter or just use it as a global variable? Pin
Vaclav_18-Apr-20 6:30
MemberVaclav_18-Apr-20 6:30 
Questioncomputational cost of math functions Pin
CalinNegru(fearless_)17-Apr-20 5:06
MemberCalinNegru(fearless_)17-Apr-20 5:06 
AnswerRe: computational cost of math functions Pin
OriginalGriff17-Apr-20 5:10
mveOriginalGriff17-Apr-20 5:10 
GeneralRe: computational cost of math functions Pin
CalinNegru(fearless_)17-Apr-20 6:58
MemberCalinNegru(fearless_)17-Apr-20 6:58 
GeneralRe: computational cost of math functions Pin
leon de boer17-Apr-20 7:04
Memberleon de boer17-Apr-20 7:04 
GeneralRe: computational cost of math functions Pin
CalinNegru(fearless_)17-Apr-20 8:14
MemberCalinNegru(fearless_)17-Apr-20 8:14 
GeneralRe: computational cost of math functions Pin
Joe Woodbury17-Apr-20 10:43
professionalJoe Woodbury17-Apr-20 10:43 
GeneralRe: computational cost of math functions Pin
Member 798912217-Apr-20 11:47
MemberMember 798912217-Apr-20 11:47 
GeneralRe: computational cost of math functions Pin
Joe Woodbury17-Apr-20 12:53
professionalJoe Woodbury17-Apr-20 12: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.