When is an object created and what is its lifetime?

Answer Posted / nikhil

global scope,if created outside class n local scope if
created inside a class......

Is This Answer Correct ?    3 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the important components of cohesion?

639


What is polymorphism and its types?

691


program for insertion ,deletion,sorting in double link list

2359


What is the use of oops?

694


What are main features of oop?

732






What is difference between class and object with example?

674


What is a null tree?

735


How Do you Code Composition and Aggregation in C++ ?

24419


Write A Program to find the ambiguities in Multiple Inheritance? How are they resolved.(Virtual Functions)

3659


Where You Can Use Interface in your Project

1506


to find out the minimum of two integer number of two different classes using friend function

1740


What is the benefit of oop?

648


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

3365


What is encapsulation in oop?

682


can we make game by using c

3567