Hi :
I tried examples of these and got more confused.....li ke i pointed out for rule number three, i seen contradictions what is mentioned there and what is true about virtual functions, I'm really confused.One liner responses to my questions
will also do....
thanks.
User Profile
Collapse
-
Are these valid rules in C++ ?
How many rules below are valid in C++
Use of pointers:
1) base-class pointer to base-class object is ok
2) derived-class pointer to derived-class object is ok
3) base-class pointer to derived-class object is ok, but only for reference to base-class members
==>Is this rule valid for virtual functions ?? As per my knowledge we can invoke
derived class virtual function with base... -
Need information on data model and factory pattern
Hi all :
In some implementation i wanted to use data model and make use of factory
design pattern.Can i get quick links/explanation about the same ??
thanks. -
Max no of objects in c++
Hi :
I have two doubts :
1) Whats is the maximum no of objects we can define of the same class ?
2)If we have created instance of a class in particular method belong to the same
class or its friend class ( as mentioned below), what is the scope of this
object ?? will it get destroyed once we return from the method ??
void method x()
... -
yes i understood.But have some more questions
1) Anyway you are redefining variable again as extern int Var etc.. then whats
the use of defining this variable as extern ( isn't it not as good as defining int Var) ?
2) Do extern variables retain same value as originally defined variables ?Leave a comment:
-
deoashish, can u explain it with a code ?? anyway im not getting what you want to
say, like suppose we have 1.c and 2.c both include 1.h.We have defined count
variable in 1.h which is been included in both 1.c and 2.c , so at second place
you will define count as "extern count " instead of including 1.h ???
is that correct ?Leave a comment:
-
Extern in c/c++
Hello :
Can anyone please elaborate in detailed use of extern in c/c++.The articles i read
say " its used for those methods/functions defined somewhere else",
e.g.extern 'function name', extern"C" etc..
thanks,
chetan.
No activity results to display
Show More
Leave a comment: