www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/05/13/21:46:26

From: Neil Roy <nitehackr AT sprint DOT ca>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Problems with variables
Date: Wed, 13 May 1998 17:01:42 -0400
Organization: Pretty bad, but improving. ;)
Lines: 31
Message-ID: <355A0A36.D105F717@sprint.ca>
References: <3553258D DOT 5C54 AT bergen DOT mail DOT telia DOT com>
Reply-To: royn AT usa DOT net
NNTP-Posting-Host: hme1-2.news.sprint.ca
Mime-Version: 1.0
Cache-Post-Path: michelob!unknown AT spc-isp-kgn-uas-01-35 DOT sprint DOT ca
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

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.

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



- Raw text -


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