what is a callback function?
Answers were Sorted based on User's Feedback
Answer / www.lutix.com
A function that is passed (by reference) to another
function. The other function calls the callback function
under defined conditions
Is This Answer Correct ? | 11 Yes | 1 No |
Answer / m.shanmuga sundaram
Definition:
***********
Functions that are triggered when an associated event
happens.
example
*******
a) In C language function pointer is used as a callback
functions.
b) In C++ virtual function are used as a callback function.
c) In c# delegate keyword is used to create a call back
function.
example in c#
*************
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
public delegate int execute(int a, int
b); //declare a delegate method
static void Main(string[] args)
{
Program p = new Program();
execute ex = new execute(p.add);
Console.WriteLine(ex(2,3)); //add method is
executed
ex = new execute(p.subtract);
Console.WriteLine(ex(2, 3)); //subtract method
is executed
}
public int add(int a, int b)
{
return (a + b);
}
public int subtract(int a, int b)
{
return (a - b);
}
}
}
Is This Answer Correct ? | 11 Yes | 1 No |
Answer / geetha
hi Amit,
Thank you for giving Definition. Can you give some example?.
Thanks,
Geetha
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / amit bhardwaj
one object to send message to other object is called
callback and the Methos use to call back message are known
as callback method.
Is This Answer Correct ? | 3 Yes | 2 No |
How assembly versioning in .NET prevent DLL Hell problem?
Is string passed by reference in c#?
Difference between StackPanel and RelativePanel ?
What are the types of serialization?
Is void a class?
List the different stages of a thread?
What is garbage collector and where should you use in .NET?
Can you declare struct members as protected?
Write a syntax for writing a event delegate.
What is the difference between string keyword and system.string class?
How to include c++ header files in c# components?
In the page load event I assigned dropdownlist’s datasource property to a valid list. On the submit button click.. The same datasource property is coming as null. Why?