ALLInterview.com :: Home Page
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   Errors
   Testimonials Refer this Site  Refer This Site to Your Friends  Site Map  Contact Us      
   
 
 Categories >> Software >> Programming Languages >> C++ >> OOPS
 
Suggest New Category 
 


 

Question Asked @ Answers Views     Select
how many types of notations are in java    0  68
what is the 3 types of system development life cycle    0  810
what is difference between class template and template class?    0  723
WAP to generate 2n+1 lines of the following pattern on the computer screen:    1  1847
Following are the class specifications: class {int a}; class {int b}; Using friend funtion,calculate the max of two objects and display it.    0  438
What is this interview room ? Is it a class or an object. cybage   2  5101
The type of variable a pointer points to must be the part of pointer's definition so that: infosys   1  1558
OOP'S advantages of inheritance include: infosys   1  2083
How to create a comment page in C #??    2  1246
what is difference between thread and programme. ncc   0  536
can you give the dynamic polymorphism types? wipro   2  12016
what is the new version of c++ ignou   1  1642
what is the new version of oops ignou   0  641
write a C++ program for booking using constructor and destructor. hal   0  605
which is best institute to learn c,c++ in ameerpet hyderabad    1  562
E-Mail New Answers        Answer Selected Questions        Post New oops Questions
  Next
 
 
 
 
 
Un-Answered Questions
 
 Question Views   Select
 
Write a C++ program without using any loop (if, for, while etc) to print prime numbers from 1 to 100 and 100 to 1 (Do not use 200 print statements!!!) 534
write string class as your own class in java without using any built-in function 725
Question In a class, there is a reference or pointer of an object of another class embedded, and the memory is either allocated or assigned to the new object created for this class. In the constructor, parameters are passed to initialize the data members and the embedded object reference to get inialized. What measures or design change should be advised for proper destruction and avioding memory leaks, getting pointers dangling for the embedded object memory allocation? Please suggest. Question Submitted By :: Sunil Kumar I also faced this Question!! Rank Answer Posted By Re: In a class, there is a reference or pointer of an object of another class embedded, and the memory is either allocated or assigned to the new object created for this class. In the constructor, parameters are passed to initialize the data members and the embedded object reference to get inialized. What measures or design change should be advised for proper destruction and avioding memory leaks, getting pointers dangling for the embedded object memory allocation? Please suggest. Answer # 1 use copy constructors 0 Shanthila There is something to be taken care in destructor, in copy constructor, suppose the memory is assigned to the embedded member object pointer with the parameter passed value, but if some other objects of different class also are pointing to this memory, then if some one deletes the object then this class member pointer object will become dangling, or if the object is not deleted properly then there will be memory leak. Please suggest the design change required to handle or avoid this situation 493
What is byval and byref? What are differences between them? 385
Write A Program to find the ambiguities in Multiple Inheritance? How are they resolved.(Virtual Functions) 2164
#include <stdio.h> #include <alloc.h> #include <stdlib.h> #include <conio.h> void insert(struct btreenode **, int); void inorder(struct btreenode *); struct btreenode { struct btreenode *leftchild; struct btreenode *rightchild; int data; }; main() { struct btreenode *bt; bt=(struct btreenode *)NULL; int req,i=1,num; clrscr(); printf("Enter number of nodes"); scanf("%d",&req); while(i<=req) { printf("Enter element"); scanf("%d",&num); insert(&bt,num); i++; } inorder(bt); } void insert(struct btreenode **sr, int num) { if(*sr==NULL) { *sr=(struct btreenode *)malloc (sizeof(struct btreenode)); (*sr)->leftchild=(struct btreenode *)NULL; (*sr)->rightchild=(struct btreenode *)NULL; (*sr)->data=num; return; } else { if(num < (*sr)->data) insert(&(*sr)->leftchild,num); else insert(&(*sr)->rightchild,num); } return; } void inorder(struct btreenode *sr) { if(sr!=(struct btreenode *)NULL) { inorder(sr->leftchild); printf("\n %d",sr->data); inorder(sr->rightchild); } else return; } please Modify the given program and add two methods for post order and pre order traversals. 455
which feature are not hold visual basic of oop? 479
can we make game by using c 1053
diff between Virtual mathod and abstract method? 929
hi all..i want to know oops concepts clearly can any1 explain?? 530
i got a backdoor offer in process global,Bangalore..Can i work with it? 1099
How to use CMutex, CSemaphore in VC++ MFC 1958
assume the program must insert 4 elements from the key board and then do the following programs.sequential search(search one of the elements),using insertion sort(sort the element) and using selection sort(sort the element). 484
Please send ford technologies placement paper 2 my mail id 485
what is different between oops and c++ 640
E-Mail New Answers        Answer Selected Questions