Showing posts with label Languages. Show all posts
Showing posts with label Languages. Show all posts

The C programming language was developed at Be...Image via Wikipedia

1.(i) in c there is no oop concept but in c++ have oop concept
(ii) In C program divide into number of sub-parts called function.but in C++ program divide into number of sub-parts called methods

2. Yes we can pass arguments to main

3.Even though static and constant variable are common for all a objects the value of static variable can be increased in time being but it cannot be increased in constant variable

4. void main()
{ if(printf("Hello world")){}}

5.The answer is 44..
As the space is an empty character and one the compiler counts one more character for the Null character constant '/0' And the space that Null takes in memory is 4 bytes same as int but this value depends on the Compiler that you use

6.2 bytes of memory because the pointer variable, whatever data type it maybe pointing to is always an unsigned integer as the address is always a positive integer, hence requiring 2 bytes of memory

7.option c is wrong i.e. a1->p1. Because a1 is not a pointer you can not refer its member through -> operator

8.The major difference between methods and functions is that methods called by the reference variables called objects where as the functions do not having any reference variables.

9.We can list as:

i. In classes the default scope is private whereas in structures u have public.equir

ii.Also u can define the scope according to is requirements in classes.

iii. In classes u can create functions and methods which is not so in the case of structures.

iv.You can also do operator overloading in case of classes which is not so in d case of structures.

v.Various other object - oriented features are found in classes and not in structures wherin u can create objects which is not possible in structures.

10.if both the base class and derived class can have the constructors,if the derived class is to call the constructor of its own using its object,it can.but when it calls its destructor,the compiler calls the destructor of base class.thats why the virtual destructor concept is coined. but there are no virtual constructors
Reblog this post [with Zemanta]
1.Tell one difference which is in C and not in C++.

2.Can we pass arguments in main()

3. Difference between static and constant variable

4.Write "hello world program" without using any semicolon in C

5.What is the output of following program
#include stdio.h
void main()
{
printf("%d%d",sizeof(NULL),sizeof(" "));
}
6.If we declare a pointer like char *p;how much memory is allocated for pointer variable p.

7.Struct out {struct in{ char c;int d;}s1,*p1;}a1, *pa1;pa1 = &a1;a1.p1 = &s1;Which is incorrect?
a). a1.p1->c b). pa1->p1->c c). a1->p1 d). a1.s1.c

8.What is the difference between methods and functions

9.Difference between class and structure

10.Explain the need for "Virtual Destructor".

11.What is the difference between "C structure" and "C++ structure".

12. Diffrence between a "assignment operator" and a "copy constructor"

13. What is the difference between "overloading" and "overridding"?

14. Explain the need for "Virtual Destructor".

15. Can we have "Virtual Constructors"?

16. What are the different types of polymorphism?

17. What are Virtual Functions? How to implement virtual functions in "C"

18. What are the different types of Storage classes?

19. What is Namespace?

20. What are the types of STL containers?.

21. Difference between "vector" and "array"?

22. How to write a program such that it will delete itself after exectution?

23. Can we generate a C++ source code from the binary file?

24. What are inline functions?

25. What is "strstream" ?

26. Explain "passing by value", "passing by pointer" and "passing by reference"

27. Have you heard of "mutable" keyword?

28. What is a "RTTI"?

29. Is there something that I can do in C and not in C++?

30. What is the difference between "calloc" and "malloc"?

31. What will happen if I allocate memory using "new" and free it using "free" or allocate using "calloc" and free it using "delete"?

32. Difference between "printf" and "sprintf".

33. What is "map" in STL?

34. When shall I use Multiple Inheritance?

35. Explain working of printf.

36. Talk sometiming about profiling?

37. How many lines of code you have written for a single program?

38. How to write Multithreaded applications using C++?

39. Write any small program that will compile in "C" but not in "C++"

40. What is Memory Alignment?

41. Why preincrement operator is faster than postincrement?

42. What are the techniques you use for debugging?

43. How to reduce a final size of executable?

44. Give 2 examples of a code optimization.

Reblog this post [with Zemanta]