Mail Archives: djgpp/1998/05/14/17:31:31
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 -