[prev in list] [next in list] [prev in thread] [next in thread]
List: hpux-cxx-dev
Subject: CXX-DEV: Typical Observation
From: "Prashun Gupta" <prashung () iin ! com>
Date: 2004-10-27 8:57:51
Message-ID: 0e3c01c4bc01$5e288700$cd1ba4a4 () cslpnm ! com
[Download RAW message or body]
I will like to verify following behaviour
$cat test.h
#include<stdio.h>
#include<malloc.h>
#include<iostream.h>
class abc
{
public:
void fun()
{
cout << " I am in function";
}
};
$cat test.c
#include"test.h"
int main()
{
abc *c1=NULL;
c1->fun();
return 1;
}
The output is
I am in function
Compiler is
HP aC++ B3910B A.03.15
HP aC++ B3910B X.03.14.06 Language Support Library
My question is when I have c1 as null then why I am able to access fun() and
getting this output.
Thanks
Prashun
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
---------------------------
Prashun Gupta
Tekmark Compucom International Solutions Llc.
(Telecom NMS Division)
IT-14/15 EPIP Sitapura Ind. Area,
Jaipur Rajasthan India 302017
Phone:
91-141- 5115907(Direct Office)
91-141-2770131,2,3 x123,124(Office EPABX)
91-141-3276997(Mobile)
91-141-2754337(Residence)
1-732-383-1223(USA VOIP number)
Fax
91-141-2770335
_________________________________________________________________
To leave this mailing list, send mail to majordomo@cxx.cup.hp.com
with the message UNSUBSCRIBE cxx-dev
_________________________________________________________________
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic