When is an object created and what is its lifetime?

Answer Posted / alok pandey

When the constructor called then object created thus while
the programme execute till life of object

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

#include #include #include #include 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.

3257


What is polymorphism give a real life example?

566


What are the 4 main oop principles?

687


What language is oop?

599


what is graphics

2013






write a C++ program for booking using constructor and destructor.

2055


What is pointer in oop?

541


What is difference between multiple inheritance and multilevel inheritance?

606


Can static class have constructor?

587


What are the 5 oop principles?

605


What is meant by oops concept?

616


What does it mean when someone says I oop?

587


What is overriding in oop?

552


Write a program to sort the number with different sorts in one program ??

1924


What is oops and its features?

592