Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!cs.utexas.edu!asuvax!ncar!unmvax!bbx!tantalum!wjb From: wjb@tantalum.eds.com (Bill Biesty) Newsgroups: comp.sys.mac.programmer Subject: Re: Returning Addresses from functions Message-ID: <1991Mar19.230119.1151@edsr.eds.com> Date: 19 Mar 91 23:01:19 GMT References: <7984@crash.cts.com> Sender: usenet@edsr.eds.com Organization: EDS Research, Albuquerque, NM Lines: 23 In article <7984@crash.cts.com> kevin@crash.cts.com (Kevin Hill) writes: -> -> ->I wish to create functions that return a pointer to a memory location. ->Similar to malloc. However, whenever the calling function is not in the ->same file as the pointer returning function, the address returned is only ->4 bytes long. I.e. if the address was originally -> Actual Returned -> 0x1D1DFFFF 0x0000FFFF -> 0x3F175432 0x00005432 -> ->it seems that only 4 bytes are returning from the function when it is ->another .c file. HOWEVER, when the calling function and the function ->itself are in the same .c file, there is not a problem.. The addresses ->are returned correctly... -> Any ideas?? Hmm. If the function is not declared as returning a pointer in the file it's called from then it's assumed to be returning an int. This is a super obvious explanation and I don't have the reference to verify int and pointer sizes. Bill