Hi All, I am new to programming and want to know how can i write a code to take input of 2 numbers from user and swap it without using a temp variable?
NIIT,
2 3590How can i write a code in c# to take a number from the user and then find all the prime numbers till the number entered by the user.
4 6057why we are declare the function in the abstract class even though we are declaring it in Derived class?
TCS,
1 2993Write 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!!!)
HCL,
1638Write a program to implement OOPS concepts such as inheritance, polymorphism, friend function, operator overloading?
TCS,
4239c++ provides classes...and classes do what we want but why then strcut are used...if we say data hiding... it is also provided by c++ in structs then why to prefer clasess
1 3935
what are the ways in which a constructors can be called?
What is a class oop?
What is the use of oops?
What is coupling in oops?
What is abstraction in oops?
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
What is difference between polymorphism and inheritance?
what are the different types of qualifier in java?
What is byval and byref? What are differences between them?
What is the types of inheritance?
Give an example where we have to specifically use C programming language and C++ programming language cannot be used?
can inline function declare in private part of class?
write string class as your own class in java without using any built-in function
What are constructors in oop?
When not to use object oriented programming?