Unsigned long question

Peter J Diaz de Leon peter at csd4.csd.uwm.edu
Thu Aug 9 07:29:13 AEST 1990


I am having problems with the following simple piece of code.
When reg1 is an unsigned int mode prints out correctly.
When reg1 is an unsigned long int mode prints out 
incorrect results. I have tried both Turbo C 2.0
and Turbo C++ 1.0 and get the strange results. 
Can somebody please explane to me what I am
over looking.

I am running on a Compaq Deskpro 286 using 
4dos ver:3.01a and DOS ver:3.31

	Thanks
	-Peter
	peter at csd4.csd.uwm.edu
	peter at cvax.cs.uwm.edu

=============================================================================

#include <stdio.h>
#define ME 0x12

test(reg1, mode)
unsigned long reg1;
int mode;
{
    printf("TEST: mode=0x%x \n", mode);
    return;
}


main()
{
    test(0x1, ME);
    return;
}



More information about the Comp.lang.c mailing list