Thank you Grumpy for the help..I wrote this code mainly to get a feel of function pointers..so just asking doubts to clarify things :)
If i use the code like u suggest..then return type of Calc...
Type: Posts; User: Sourabh Dugar
Thank you Grumpy for the help..I wrote this code mainly to get a feel of function pointers..so just asking doubts to clarify things :)
If i use the code like u suggest..then return type of Calc...
Hey one more thing Grumpy..which technique do u think is java based..?!
Grumpy I am a total beginner so I have a doubt ..where is the best place to insert delete..?
Main func passes &Plus to Calc.. therefore the Plus method returns this pointer to Calc again..Now i need...
Yeah Fordy I agree..I can return value.. but I am just a beginner..and was experimenting with pointers with this simple example :)
However the second time the program doesn't abort (the resultF...
Hey thank you Fordy.. I added float* res=new float; .. After doing this the code is working fine :)
However I have one doubt..What is the best way to delete the memory assigned to the pointers in...
The error is due to the line "std::cout<< "result inside Calc method" << *pCalcMethod(num1, num2) << std::endl;"
Hi!
I am new to C++ programming and was tinkering around with a program to learn about function pointers. I wrote the following code (using borland c++ compiler). The program compiles without error...