C
Chetan Raj
Hi All,
One of my friend asked this question on C++
Hi,
Can u give an answer to this :
We have the .h files for standard library. Consider any class (such as
ostream) declared in the .h files. Can I edit the .h file to declare my
own function as friend inside the class declaration and then gain
access to private data members of ostream? Will the compiler allow
this?
If yes, that means we can gain access to private data members to even
3rd party libraries. How much useful/destructive that is, is a
different issue.
--Ankit
<<<
We all know that this will not be possible, beacuse the information
about the private variables will not be available in library (.lib or
..a files) and the linker will complain.
Can any one elaborate on this issue?
Thanks,
Chetan Raj
One of my friend asked this question on C++
Hi,
Can u give an answer to this :
We have the .h files for standard library. Consider any class (such as
ostream) declared in the .h files. Can I edit the .h file to declare my
own function as friend inside the class declaration and then gain
access to private data members of ostream? Will the compiler allow
this?
If yes, that means we can gain access to private data members to even
3rd party libraries. How much useful/destructive that is, is a
different issue.
--Ankit
<<<
We all know that this will not be possible, beacuse the information
about the private variables will not be available in library (.lib or
..a files) and the linker will complain.
Can any one elaborate on this issue?
Thanks,
Chetan Raj