Ask Questions & Get Answers at ibibo sawaal
     Powered by Bixee Crawl
Results 1 - 15 of about 380 sawaal for "constructor"
Sort by: Recency | Relevancy

What is Constructor?

Hello..In a C class definition, a member function with thesame name as the class is a constructor. This is a function whichis called automatically whenever an instance of the class is created. Constructorsare typically used to initialize the data members of the object to theirdefault state, but may also be used to allocate resources memory, files,etc.. For any class, a number of constructor functions may

Posted in Computers & Technology by bwd at 5:27 PM on September 06, 2008

WHat is constructor ?

A constructor is a special method for initializing a new instance of a class.The constructor method for a class will have the same name as the class.Example shows a class and a constructor named constructors. In this case, each constructor will have the same name, but will have different arguments.A no-argument constructor is a constructor which does not take any arguments....hi singh A constructor is a

Posted in Computers & Technology by Sharad Singh at 4:56 PM on May 16, 2008

Are C constructors the same as C constructors?

well Radhe, C constructors are very similar with C constructors. Like C, methods are non-virtual by default, but can be marked as virtual. There is also some difference between C and C, C supports multiple inheritance of interfaces, but not of classes. Another difference is destructors, their syntax is same with C but actually they are very different.C supports constructor chaining. This means one

Posted in Computers & Technology by Radhe Radhe at 8:00 PM on May 30, 2008

What is the difference between a constructor and a method?

Constructor - a special member function for automatically creating an instance of a class. This function has the same name as the class.Method - The means by which an object receives and responds to a particular kind of message. In C, a method is a member function...The difference between constructor and method are given below-A constructor is a member function of a class that is used to create

Posted in Computers & Technology by rocky singh at 4:53 AM on June 22, 2008

What is the difference between a constructor and a method?

Hi,Constructor is a member function of the class, with the name of the function being the same as the class name where as it is not the case of a method.for example:class XYZXYZ //Constructor------XYZ String x //Constructor with arguments-------Where as a method is an ordinary member function of a class. It has its own name, a return type which may be void, and is invoked using the dot operator.A Method

Posted in Computers & Technology by jks marven at 12:32 PM on May 28, 2008

Explain the concept of constructor and destructor with example?

Constructors are invoked in the following order.1Virtual base class constructors in the order of inheritance2Non-Virtual base class constructors in the order of inheritance3Member objects constructors in the order of declaration4Derived class constructorDestructors are invoked in the reverse order....Because classes have complicated internal structures, including data and functions, object

Posted in Computers & Technology by rakesh at 8:29 PM on October 27, 2007
Tags eng

How do I enforce const correctness in C?

that a method does not modify the object on which it is acting. C constructs objects from base to derived, so when the base constructor is executing the object is effectively a base object, and virtual method calls are routed to the base class implementation. By contrast, in .NET the derived constructor is executed first, which means the object is always a derived object and virtual method calls

Posted in Computers & Technology by Radhe Radhe at 8:02 PM on May 30, 2008

What is the "Named Constructor Idiom"?

A technique that provides more intuitive and/or safer construction operations for users of your class.The problem is that constructors always have the same name as the class. Therefore the only way to differentiate between the various constructors of a class is by the parameter list. But if there are lots of constructors, the differences between the constructors becomes somewhat subtle and error prone

Posted in Computers & Technology by surajkumar at 11:22 PM on November 13, 2008

What is a constructor?

In object-oriented programming, a constructor sometimes shortened to ctor in a class is a special block of statements called when an object is created, either when it is declared statically constructed on the stack, possible in C but not in Java and other object-oriented languages or dynamically constructed on the heap through the keyword new.A constructor is similar to an instance method

Posted in Computers & Technology by chinni. at 11:29 PM on November 04, 2008

Define Copy Constructor

Copy constructor is the constructor that creates a new class object from an existing object of the same class....Copy constructor is a function that specifies how you should copy the fields. If you. so we can say that a copy constructor of a class A is a nontemplate constructor in which the first parameter is of type A&, const A&, volatile A&, or const volatile A&, and the rest

Posted in Computers & Technology by Sid at 10:26 PM on February 01, 2008

Where to get the concept of pointers,new,delete and objects memory location in C!!!!!!!!!!!!!!!!!!!!!!!!!!1

well, include <iostream>using namespace std;class basicpublic:basic cout << "constructor called" << endl; basic cout << "destructor" << endl; ;int mainstatic basic bp = new basic;//delete bp;Output without the explicit delete call:constructorOutput with the explicit delete call:constructordestructor...include <iostream>using namespace std

Posted in Computers & Technology by tanmay shah at 9:03 PM on July 03, 2008

Which constructor gets called when I create an array of Fred objects?

Well Suraj! Freds default constructor except as discussed below. class Fred public: Fred; ... ; int main Fred a[10...]; calls the default constructor 10 times Fred p = new Fred[10...]; calls the default constructor 10 times ... If your class doesnt have a default constructor, youll get a compile-time error when you attempt to create an array using the above simple syntax: class Fred public

Posted in Computers & Technology by surajkumar at 11:22 PM on November 13, 2008

What is reflection in c

to the Reflection API. It provides methods for obtaining information about a type declaration, such as the constructors, methods, fields, properties, and events of a class, as well as the module and the assembly Type t = typeof test ;Console.WriteLine "Type of class: " t ;Console.WriteLine "Namespace: " t.Namespace ;ConstructorInfo[...] ci = t.GetConstructors ;Console.WriteLine "Constructors

Posted in Computers & Technology by VAISHNAVI at 10:06 PM on June 13, 2008

Should you use the this pointer in the constructor?

Some people feel you should not use the this pointer in a constructor because the object is not fully formed yet. However you can use this in the constructor in the body and even in the initialization list if you are careful.Here is something that always works: the body of a constructor or a function called from the constructor can reliably access the data members declared in a base class and

Posted in Computers & Technology by surajkumar at 11:23 PM on November 13, 2008

How do I enforce const correctness in C?

passed in to it. And theres no way to specify that a method does not modify the object on which it is acting. C constructs objects from base to derived, so when the base constructor is executing the object is effectively a base object, and virtual method calls are routed to the base class implementation. By contrast, in .NET the derived constructor is executed first, which means the object is always a derived object

Posted in Computers & Technology by Nidhi Singh at 2:46 PM on August 13, 2008
Refine By Date
sawaal signature
sawaal free visiting card