Help finding the 15/16 complement of a hex number(C++) - Programming - Nairaland
Nairaland Forum › Science/Technology › Programming › Help finding the 15/16 complement of a hex number(C++) (3995 Views)
| Help finding the 15/16 complement of a hex number(C++) by skydancer(op): 5:17pm On Aug 09, 2011 |
Okay, there's this crazy assignment that's been giving me trouble on c++. Find the 15's and 16's complement of a given hex number using comma operator in the for loop. I have tried many methods but none seem to work yet, Anyone? |
| Re: Help finding the 15/16 complement of a hex number(C++) by dellnet: 5:40pm On Aug 09, 2011 |
http://www.rwc.uc.edu/koehler/comath/12.html makes any sense? |
| Re: Help finding the 15/16 complement of a hex number(C++) by Nobody: 5:58pm On Aug 09, 2011 |
@ OP The link that dell_net posted should be sufficient. Do you still need further assistance? |
| Re: Help finding the 15/16 complement of a hex number(C++) by skydancer(op): 11:00am On Aug 10, 2011 |
The problem is not the method, it's just the 'c++' thing. How to manipulate strings. . . |
| Re: Help finding the 15/16 complement of a hex number(C++) by dellnet: 11:20am On Aug 10, 2011 |
anyways here is c++ string |
| Re: Help finding the 15/16 complement of a hex number(C++) by skydancer(op): 3:43pm On Aug 10, 2011 |
Lol, dell_net. I think you are lost on how to go about it too :p |
| Re: Help finding the 15/16 complement of a hex number(C++) by Nobody: 4:58pm On Aug 10, 2011*. Modified: 10:04pm On Apr 13, 2013 |
| Re: Help finding the 15/16 complement of a hex number(C++) by dellnet: 6:12pm On Aug 10, 2011 |
skydancer:I would convert it to base 2 first and then get the result just not sure what you need string for. |
| Re: Help finding the 15/16 complement of a hex number(C++) by dellnet: 6:40pm On Aug 10, 2011 |
you did not ask for code but omo is offering so plead with omo to give you. seriously i did not attempt anything in c++ i guess chivalry is dead today ![]() |
| Re: Help finding the 15/16 complement of a hex number(C++) by skydancer(op): 7:45pm On Aug 10, 2011 |
omo_to_dun:Why do you say it's not what I want, I'm a damn beginner in c++. Spent 2 hours without coming out with anything meaningful, And have an exam tomorrow, No time to really settle down and read anything. |
| Re: Help finding the 15/16 complement of a hex number(C++) by Nobody: 12:43am On Aug 11, 2011*. Modified: 10:04pm On Apr 13, 2013 |
| Re: Help finding the 15/16 complement of a hex number(C++) by Nobody: 12:48am On Aug 11, 2011*. Modified: 10:04pm On Apr 13, 2013 |
| Re: Help finding the 15/16 complement of a hex number(C++) by Nobody: 12:49am On Aug 11, 2011*. Modified: 10:04pm On Apr 13, 2013 |
|
| Re: Help finding the 15/16 complement of a hex number(C++) by skydancer(op): 9:13pm On Aug 13, 2011 |
@omo_to_dun: Thanks, I really appreciate. Your coding flavour is kinda sweet. I was nearly staring at std::string for 2 mins. But the comments are superb, But isn't the hexto16 supposed to call hex15to16 with the parameter as hextto15? |
| Re: Help finding the 15/16 complement of a hex number(C++) by Nobody: 10:44pm On Aug 13, 2011*. Modified: 10:04pm On Apr 13, 2013 |
| Re: Help finding the 15/16 complement of a hex number(C++) by skydancer(op): 9:36am On Aug 14, 2011 |
K. SO what's the std:: calls about? Is it faster than adding 'using namespace std;' at the top or is it simply your style? |
| Re: Help finding the 15/16 complement of a hex number(C++) by Nobody: 10:03am On Aug 14, 2011*. Modified: 10:04pm On Apr 13, 2013 |
Need Help Finding An Inventory Control And Management Software • Help Finding Python 3 Web Host. Pls • Hex File Help • 2 • 3 • 4
Expert Systems With Visual Basic • What U Need To Know Before Learn A Programming Language • My Experience Using An AMD Based System
