Raised This Month: $ Target: $400
 0% 

bitsum to flags?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 02-15-2009 , 20:37   bitsum to flags?
Reply With Quote #1

Is there a snippet/function that converts a bitsum to a-z flags?
I made my own, but I wanted to know if one already existed in a better form:
Code:
bits_to_flags(const bits, flags[], len) {     static const letters[][] =     {         "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m",         "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"     }         flags[0] = 0;     for( new i = 0; i < sizeof(letters); i++ )     {         if( bits & (1<<i) )         {             add(flags, len, letters[i]);         }     } }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
 



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


All times are GMT -4. The time now is 16:56.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode