From: "vadiraj c s" Subject: code explaination Date: 18 Sep 2003 09:37:28 -0000 Sender: linux-fsdevel-owner@vger.kernel.org Message-ID: <20030918093728.14669.qmail@mailweb34.rediffmail.com> Reply-To: "vadiraj c s" Mime-Version: 1.0 Content-Type: text/plain; format=flowed Return-path: Received: from webmail34.rediffmail.com ([203.199.83.247]:36485 "HELO rediffmail.com") by vger.kernel.org with SMTP id S262105AbTIRJjY (ORCPT ); Thu, 18 Sep 2003 05:39:24 -0400 To: linux-fsdevel@vger.kernel.org Content-Disposition: inline List-Id: linux-fsdevel.vger.kernel.org Please tell me the reason for the out put of the code #include struct xyz{ int i; int j; } pqr = {100,300} ; int main() { struct xyz *z = &pqr; abc_char(z); abc_int(z) ; } void abc_char(char *i) { printf("char abc %d",*i) ; } void abc_char(int *i) { printf("int abc %d",*i) ; } out put: char abc 0 int abc 300; swap the structure value to i=300,j = 100; you get char abc 1; can you type cast structure add to any datatype? what can be the reason for such output; regards vadiraj ___________________________________________________ Catering meets Camera; Tanya Weds Sahil. Rediff Matchmaker strikes another interesting match Visit http://matchmaker.rediff.com?1