delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/10/11/21:14:28

From: "Anthony Graham" <fonzyco AT freenetname DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Variable Passing
Date: Mon, 11 Oct 1999 20:13:00 +0100
Organization: GXSN
Lines: 44
Message-ID: <7ttdh9$plb$1@gxsn.com>
NNTP-Posting-Host: 195.147.235.35
X-Trace: 939669865 1NNUCNF1GEB23C393C gxsn.com
X-Complaints-To: abuse AT gxsn DOT com
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2014.211
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

I thought i had all the basics of C then I got stumped again.....

How do you pass variables between procedures? (Without making a global
variable)

Here's the senario....

int caller()
{
float myvalue;

myvalue=1;
called(myvalue);

}


void called(float passedvalue)
{
.....


}

This is a v. short example. If i debug my code i see that the value to be
passed is right but the "passedvalue" in the second loop is:
any of the following....
        INF(inate)
        x.xxxxE-xx
        ....
        and anything but one!!!

What am i doing wrong?

Pleaase help me!!!

If possible please respond via e-mail to
Anthony AT FonzyCo DOT Co DOT uk

This address is not to be added to any mailing lists.

Thanks in advancefor your help.


- Raw text -


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