delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/29/12:16:08

Message-Id: <3.0.5.32.19980829131459.007c13f0@200.252.238.1>
Date: Sat, 29 Aug 1998 13:14:59 -0300
To: djgpp AT delorie DOT com
From: "Thiago F.G. Albuquerque" <thiagofga AT ambr DOT com DOT br>
Subject: Re: 2 quick questions
In-Reply-To: <35e75646.2796107@cnews.newsguy.com>
References: <35D4F001 DOT 4A3E2B2D AT xyz DOT net>
Mime-Version: 1.0

At 01:22 29/08/98 GMT, you wrote:
>On Fri, 14 Aug 1998 18:18:41 -0800, Bjorn Hansen <viking AT xyz DOT net>
>wrote:
>
>>1]  what does the exit code tell you?
>>
>>2] why does the compiler have a warning message if you don't use a
>>caste? when you do something like this
>>
>>int i;
>>int *ip;
>>ip=i;
>>
>>instead of this
>>
>>int i;
>>int *ip;
>>ip=(int *)i;
>>
>>
>>Bjorn Hansen

The correct code would be:

int i;
int *ip;
ip=&i;

Use the 'address-of' operator (&) to tell the compiler that what you want
in ip is the *adress* of 'i', not the contents 'i' itself.

[],
Thiago

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019