Showing posts with label OOPs. Show all posts
Showing posts with label OOPs. Show all posts

Saturday, April 30, 2011

Difference between call by out and call by reference

out = ref -  (intiliazation)

void main()
{

int x,y,o,r;

//ref
r=0;
MultiMath(x,y,ref r);
MultiMath(x,y,out o);

}



functions

OUT
private int MultiMath(int a, int b, out o)
{
    o = a*b;
return a+b;
}

REF
private int MultiMath(int a, int b, out r)
{
    r = a*b;
return a+b;
}

http://www.c-sharpcorner.com/UploadFile/5eae74/6867/

Tuesday, January 18, 2011

Threading

Trheading :

AutoResetEvent allows threads to communicate with each other by signaling. Typically, this communication concerns a resource to which threads need exclusive access.
A thread waits for a signal by calling WaitOne on the AutoResetEvent. If the AutoResetEvent is in the non-signaled state, the thread blocks, waiting for the thread that currently controls the resource to signal that the resource is available by calling Set.