Thread: I hate "C"
View Single Post
  #5   Spotlight this post!  
Unread 20-01-2007, 00:34
dcbrown dcbrown is offline
Registered User
AKA: Bud
no team
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Hollis,NH
Posts: 236
dcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud of
Re: I hate "C"

Quote:
The two types are essentially the exact same: both are unsigned, 4 byte numerical variables
Both are signed values unless "unsigned" specifier user.

C18 2.1 Data Types and Limits in user guide:
char : signed 8 bits
int, short : signed 16 bits
short long: signed 24 bits
long : signed 32 bits
float : 32 bits
double : 32 bits

The v2.4 C18 library guide says it supports size qualifiers, so could try %ld instead of %d for the long variables. Drop the int cast if using %ld.

Last edited by dcbrown : 20-01-2007 at 00:45.