It depends on the library. Using a GPL library is NOT the way to go if you ever intend to have a remote chance of selling your os, as it requires projects using it to be open source and freely distributed. (If I'm not mistaken, the freestanding ones are exempt from this rule). Other libraries will allow you to use them with permission or attribution (Putting the author's name in an easily visible spot in your os - such as an about dialog). "Public domain" or "Copyright waived" libraries can be used for any purpose, commercial or personal, with or without attribution, etc, et al.TorakTu wrote: Aren't there licenses on those libraries though ? If by some LONG shot I was able to sell my tiny OS for what ever reason.. just for fun.. wouldn't I be bound to pay a fee to the creators of those said libraries ? I'm trying to avoid that.
BTW, I am not a lawyer and am not offering legal advice.
This would print your number backwards, but yes this is the standard method. What I do is make an empty character string large enough for the largest possible value + 1 and zero it (in base 10, 32 bits, unsigned):Convert the number to a binary, then bring it back in as a type of string by converting it back to ASCII into the end of the array as an appended byte. I know what I'm trying to say, I just probably am not clear about the way I am saying it. I'll have to experiment with this idea.Code: Select all
a = 0 while(n != 0) answer[a] = n mod b n /= b a++
Code: Select all
---------------------------------------------
| | | | | | | | | | | |
---------------------------------------------
Code: Select all
---------------------------------------------
| | | | | | | | | | 53| |
---------------------------------------------
Code: Select all
---------------------------------------------
| | | | | | 49| 50| 51| 52| 53| |
---------------------------------------------
Code: Select all
-------------------------
| 49| 50| 51| 52| 53| |
-------------------------
PS, bases > 10 are a bit more difficult. That's your homework.
EDIT: zeroes are represented as a space for readability.