|
||||||
| C and C++ C and C++ forum for discussing all forms of C except for C#. These languages are powerful low level languages used for creating Operating Systems, Device Drivers, compilers and much more. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
Hey guys im new here and not to sure if im posting this in the right area but i need abit of help with a couple "easy" programs. Im trying to write a short test program that will
1) display an unsigned integer to the screen as a hex number from 0000 to FFFF 2) display an unsigned integer to the screen as a decimal number from 0 65535 3) read a 4 digit hex number, 0000 to FFFF, and store it as a unsigned int. 4) read a 5 digit dec. number, 00000 to 65535, and store it as a unsigned int. if any can help me out that would be amazing |
| Sponsored Links |
|
|
|
|||||
|
Do you have any code so far? To display use "cout". To read input into variables use "cin". Do you know how to declare integer variables?
__________________
CodeCall Blog | CodeCall Wiki | Shareware Site | Linux Forum | Write a Blog Don't hesitate to ask any questions that you have! Check out our ASCII Calculator! |
|
|||
|
It's worth asking if you are using C or C++. The answer varies dependent.
If you are using C you'll want to replace cin/cout with scanf and printf.
__________________
Currently bemused by: LLVM. |
|
|||
|
For C, use printf and scanf like so:
1) printf("%04X",myUInt); 2) printf("%u",myUInt); 3) scanf("%4x",&myUInt); 4) scanf("%d",&myUInt); |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Software Dungeon | bungman | Shareware Sites | 10 | 08-21-2008 06:45 AM |
| Successfully Selling Your Software | Jordan | Tutorials | 11 | 07-16-2008 05:25 PM |
| Get installed software information | IUnknown | Software Development Tools | 5 | 10-15-2007 06:29 PM |
| John | ........ | 223.00000 |
| dargueta | ........ | 168.00000 |
| Xav | ........ | 164.00000 |
| LogicKills | ........ | 20.00000 |
| gaylo565 | ........ | 18.00000 |
| WingedPanther | ........ | 15.00000 |
| |pH| | ........ | 15.00000 |
| Johnnyboy | ........ | 3.00000 |
| navghost | ........ | 1.00000 |
Goal: 100,000 Posts
Complete: 67%