₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,326,166 members, 8,425,265 topics. Date: Friday, 12 June 2026 at 10:17 AM

Toggle theme

Help finding the 15/16 complement of a hex number(C++) - Programming - Nairaland

Nairaland ForumScience/TechnologyProgrammingHelp finding the 15/16 complement of a hex number(C++) (3995 Views)

1 Reply (Go Down)

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
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:
Re: Help finding the 15/16 complement of a hex number(C++) by dellnet: 6:12pm On Aug 10, 2011
skydancer:
Lol, dell_net. I think you are lost on how to go about it too :p
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 sad
Re: Help finding the 15/16 complement of a hex number(C++) by skydancer(op): 7:45pm On Aug 10, 2011
omo_to_dun:
@skydancer
I can actually post the answer if you want, but I think you don't want that, do you?
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:
Re: Help finding the 15/16 complement of a hex number(C++) by Nobody:
Re: Help finding the 15/16 complement of a hex number(C++) by Nobody:

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:
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:
1 Reply

Need Help Finding An Inventory Control And Management SoftwareHelp Finding Python 3 Web Host. PlsHex File Help234

Expert Systems With Visual BasicWhat U Need To Know Before Learn A Programming LanguageMy Experience Using An AMD Based System