delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/05/14/17:31:31

From: sparhawk AT eunet DOT at (Gerhard Gruber)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Problems with variables
Date: Thu, 14 May 1998 21:15:35 GMT
Organization: Customer of EUnet Austria
Lines: 52
Message-ID: <35615553.5947165@news.Austria.EU.net>
References: <3553258D DOT 5C54 AT bergen DOT mail DOT telia DOT com> <355A0A36 DOT D105F717 AT sprint DOT ca>
NNTP-Posting-Host: e206.dynamic.vienna.at.eu.net
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Destination: Neil Roy <nitehackr AT sprint DOT ca>
From: Gruber Gerhard
Group: comp.os.msdos.djgpp
Date: Wed, 13 May 1998 17:01:42 -0400:

>You trying to assign an integer to a character variable.
>
>     char A;     //char variable, holds one character
>     char B;     // ""                                             ""
>
>     A=45;      //Assigning integer to character variable
>
>     If you want A to be an integer you should have
>
>     int A;   // (instead of char A)
>
>    this would solve this problem.

This doesn't solve this problem because 45 fits easily into a byte variable.
If the value would be to large for the variable type the compiler would issue
a warning (or an error?).

But from the posted info I can't guess what he is doing wrong. Probably a
pointer or a reference problem.

>John Kismul wrote:
>
>> Hi
>>
>> I've got a problem with using variables in my programs.
>> Sometimes when I try to access a variable, my program will access
>> another variable instead.
>>
>>         char A
>>         char B
>>
>>         A = 45; This will set both A and B to 45.
>>
>> It doesn't happen with every variable I use, only some of them.
>> The compiler I'm using is PGCC 1.0.1
>
>
>

--
Bye,
   Gerhard

email: sparhawk AT eunet DOT at
       g DOT gruber AT sis DOT co DOT at

Spelling corrections are appreciated.

- Raw text -


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