views:

77

answers:

2

Possible Duplicate:
How do I base64 encode (decode) in C?

I am trying to convert an int into an ASCII byte array and then encode the byte array as a base64 string.

I see a few posts on how to do this in C# and Java, but I want to do this in C. I'm doing this in windows, using MS Visual Studio.

Is there a function provided that can do this?

Here's the code that I would use in C# to do this:

var base64_string = Convert.ToBase64String(System.Text.ASCIIEncoding.ASCII.GetBytes(my_integer));
A: 

How about this? http://base64.sourceforge.net/

Matt Ball
A: 

There are a lot of libraries available for that. One example is libb64, which has a very permissive license.

Heinzi