Newsgroups: comp.sys.mac.programmer Path: utzoo!utgpu!watserv1!watdragon!dahlia.waterloo.edu!jpmah From: jpmah@dahlia.uwaterloo.ca (John Mah) Subject: Huh? What's wrong here... (A Simple Think C question) Message-ID: <1991Apr14.021934.8840@watdragon.waterloo.edu> Originator: jpmah@dahlia.waterloo.edu Sender: news@watdragon.waterloo.edu (News Owner) Organization: University of Waterloo Date: Sun, 14 Apr 1991 02:19:34 GMT Lines: 26 Ok. Simple it is, but I still can't figure out what's wrong: I have a function: long _get_new_hash_val(some parameters) etc, etc... { long value; ...some statements... return value; } Now, I call it with: *my_pointer_to_a_long = _get_new_hash_val(some parameters); Ok, it compiles fine and everything, but (upon examination with the ThinkC debugger) that when I hit the return function, value = 0x2CEDE78A. Now after I execute the *my_pointer_to_a_long assignment, it has a value of 0xFFFFE78A. What is happening is that the assignment is cutting off the two high bytes, but keeping the two low bytes. My question is: "Why does it do that and how can I fix it?". Thanks in advance. (PS. I'm using Think C 4.0.2 -- great package) -- John