Thread View: alt.comp.programming
2 messages
2 total messages
Started by Olivier Lafontaine
Fri, 20 Aug 1999 00:00
Declare an hex variable in c language
Author: Olivier Lafontaine
Date: Fri, 20 Aug 1999 00:00
Date: Fri, 20 Aug 1999 00:00
21 lines
1597 bytes
1597 bytes
Hi... I'm very new to c, no I'm new to programming languages... except a bit of visual basic... My question is about declaring variables... I know how to declare decimal or float or char... but when i try to declare an hexadecimal variable I get in error when running the file... I read somewhere that it is the same as a decimal variable: int variablename; but when i associate the hexadecimal number with variablename... there is an error example: int number; number = 1e; or 1E; both doesn't work... can someone help me! thanx O.L.
Re: Declare an hex variable in c language
Author: China Blue
Date: Thu, 19 Aug 1999 00:00
Date: Thu, 19 Aug 1999 00:00
12 lines
1530 bytes
1530 bytes
/ int number; / number = 1e; or 1E; In C, use 0x1e or 0x1E. Do not start numbers with 0, that is octal, 012 == 10. -- Collective Against Consensual Sanity http://www.angelfire.com/ca3/cacs v0.1 is sort of up. For a free CACS T-shirt send $42 shipping and handling.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads