amiga.org
     
iconAll times are GMT -6. The time now is 09:13 PM. | Welcome to Forum, please register to access all of our features.

» Amiga.org » Operating System Specific Discussions » Amiga OS » Amiga OS -- Development » Longs, ints and printf (ansi-C)

Amiga OS -- Development This particular forum deals with issues regarding development for all versions of AmigaOS.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 03-14-2004, 05:01 AM   #1
elendil
Technoid
Points: 5,541, Level: 47 Points: 5,541, Level: 47 Points: 5,541, Level: 47
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2002
Posts: 324
Send a message via ICQ to elendil
Default Longs, ints and printf (ansi-C)

Hi...

I have just finished my little hexadecimal to decimal tool, and again stumbled on the stupid 32 bit barrier of integer values...

A few questions:

a) ints and longs are usually the same these days, aren't they? The ansi-C reference I'm looking at claims ints are 16 bit and longs are 32 bits, but ints are 32 as well these days?

b) why won't printf print longs and is there any way around that (besides casting to integer)?

c) Why does an unsigned integer overflow with values such as FFFF FFAA?

d) Working with longs I appear to get no overflows no matter how big a number I use, at least the if(number < 0) is never true for longs. Why is that?

d) Work-arounds?

Thanks,

Sincerely,

-Kenneth Straarup.
elendil is offline   Reply With Quote
 

Bookmarks

Tags
ints , printf , longs , ansic

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ansi capable telnet application for OS3.x? AmiKit Amiga Software Issues and Discussion 5 04-09-2009 12:37 PM
C++ - convert string to array of ints motorollin CH / Science and Technology 12 09-01-2007 10:27 AM
printf output to string possible ? Jose Amiga OS -- Development 7 09-11-2005 04:05 AM
Karlos' weekly GNU/ANSI C++ on amiga bash :-) Karlos Amiga OS -- Development 5 04-08-2004 04:43 PM
More GNU C++ (ANSI C++ mode) oddness Karlos Amiga OS -- Development 14 03-26-2004 11:02 AM