answersLogoWhite

0

no.. object 'l be created at d run time..... PRAVEEN HIREMATH, NMAMIT,NITTE

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

What is the difference between make and compile in c?

make is a utility program, compile means translation from source to object module.


Define compile time polymorphism with short examples?

compiler can decide which form of the object should be invoked during compile time.this type of polymorphism is know as compile time polymorphism


What does a compiler do when you compile your program?

Coverts source code into object code


What is the function of glass through?

To see other object such as liquid, and solid


If object 1 call object 2 in oop in which object the excution happen?

Strictly speaking, neither. Although member functions are obviously members of an object, this is merely an abstraction. In reality, there is only one instance of every member function, not one per object. The function knows which instance it was invoked against through the implicit 'this' pointer that is passed to the function through a hidden parameter. Thus execution occurs within the function that was invoked, not within the objects itself.


What is a call by reference?

In C++ (C Plus Plus), when you call by reference, you are directly accessing the data of the referenced object. When you pass an object to a function by reference, any and all alterations to the object made within the function carry through to the actual object.


What is calling by reference?

In C++ (C Plus Plus), when you call by reference, you are directly accessing the data of the referenced object. When you pass an object to a function by reference, any and all alterations to the object made within the function carry through to the actual object.


Sorting an array of objects through in built function?

Object[] arrayToBeSorted; Arrays.sort(arrayToBeSorted);


Can a static function be made virtual?

No. Virtual functions are invoked according to the runtime type of the object. That is; the most-derived override is automatically invoked even when the runtime type of the object cannot be determined at compile time. This is achieved through the object's virtual table. Static methods do not have any object associated with them; they can be invoked even when no object of the type exists. Without an object, there can be no virtual table. Thus static functions cannot be virtual. They are mutually exclusive concepts.


What do you mean by multiple compilation?

Whenever you change the source, you have to re-compile it, to get a new object/executable.


What does bind time have to do with recursion in C plus plus?

In C++, names are either statically bound at compile time, dynamically bound at runtime or (with compile time computation) not bound at all. With respect to functions, dynamic binding only occurs when a function is invoked through a function pointer. This also applies to virtual functions because the virtual function table (vtable) is simply a list of function pointers that apply specifically to the runtime class of the object the function is invoked against. If we do not know the runtime type (the actual type) of an object at compile time, then we cannot statically bind a virtual function call at compile time. Instead, the compiler must generate code to perform a vtable lookup and then invoke the appropriate function dynamically. However, if the runtime type is known at compile time, then we can statically bind to a virtual function. Static binding is faster than dynamic binding because we eliminate the indirection required to invoke a function via a pointer variable. Although we can write code to determine the runtime type of an object and thus statically bind all function calls, the overhead far outweighs the otherwise trivial cost of an indirection. In the case of recursive functions, dynamic binding can only occur if we invoke the function through a function pointer. Once invoked, all recursive calls to that same function are statically bound: unsigned object::fact (unsigned x) { return x<2 ? 1 : x * (fact (x-1)); } Here, the name fact used within the function is implicitly bound to this->fact and is therefore statically bound to object::fact. The initial invocation may or may not have been dynamically bound, but that has no bearing once the function is invoked. If a function is declared constant expression (constexpr) and is used in a constant expression, the function call (and its binding) can be eliminated completely. Consider the following: constexpr unsigned fact (const unsigned num) { return num < 2 ? 1 : num * fact (num - 1); } void f () { unsigned x = fact (7); // ... } A good compiler will replace all of the above with the following: void f () { unsigned x = 5040; // ... } This is known as compile-time computation. We get the convenience of a function (even a recursive one) but with none of the runtime cost. And since the function is not required at runtime, there is nothing to bind to. However, constant expression functions are useful in that they can also be used in expressions that are not constant. For example: void g (unsigned x) { unsigned y = fact (x); // ... } The above call to fact cannot be computed at compile time because x is not constant, so the compiler must statically bind the function instead. Thus we get the advantage of compile time computation when it is possible to do so and static binding when it is not. If we wish to prevent static binding completely, then we need to use template metaprogramming instead: template<unsigned N> constexpr unsigned fact() { return N * fact<N-1>(); } template<> constexpr unsigned fact<1>() { return 1; } template<> constexpr unsigned fact<0>() { return 1; } Note that we must use specialisation to handle the end cases (where N is 0 or 1). It is not as elegant as the plain constexpr version, however it does guarantee that we only use compile time computation rather than static binding: void h (unsigned x) { unsigned y = fact<7>(); // OK: generates equivalent code to unsigned x = 5040; unsigned z = fact<x>(); // error: x is not constexpr // ... }


What is an object function?

A function object is a computer programming construct allowing an object to be invoked or called as if it were an ordinary function, usually with the same syntax ...