Thursday 29 September 2011

Function Pointers The art

Function pointers can be used in complex programming situations. Function pointers Speed Up the call of functions. The address of the function is passed to the function pointer.
The following steps are helpful to understand function pointers
1. Declare the function pointer identical to the function it would refer. Dont skip to bracket the pointer and the pointer name.  void (*fp)(void ).
2.  Assigne the name of the function to the function pointer variable.
3.   Pass the values to the function pointer.

Refer the example for reference


int add(int a, int b)
{
return a+b;
}

int sub(int a, int b)
{
return a>b?a-b:b-a+ add(a,b);
}

void main()
{
int (*fun)(int , int);
fun=add;
cout<<fun(10,20)<<endl;
fun=sub;
cout<<fun(10,20);
}


Write your queries , will reply if i can sort.

Tuesday 24 May 2011

Frequently Asked C++ Questions

1.What is class?
2.What are static classes ? G.E
3. What are virtual functions?
4.Can a constructor call a virtual function?
5 Why constructor can not be virtual ?
6 Why do we need virtual distructor ?
7.Why sizeof empty class is not zero?
8. What is upcasting and downcasting? which is allowed and which is not?
9. What is the difference between operator new and new operator ?
10. What happens between throw and catch?
11.What are the different types of casting in c++?Where are they used?
12 .Which one is faster post or pre increment operators?
13. If base class has  a virtual function, Does derived class can also have virtual function with the virtual key word?
14 What is the difference between new and malloc?
15 Can free and delete interchange?
16 Explain the memory organisation of a class?
17  What are design patterns?
18 What check is made to ensure that the memory allocated by malloc is not NULL?
19 What is memory leak ?Explain the concept?
20. What are copy constructors?
21 Using references make programs faster? Can You justify why?
22 Constant is static in c++ where as it is global in c?

Apache Beam Learning In Java Tutorials

 Wow  https://youtu.be/9kGETU63rkc