Duxducis
Duxducis

Reputation: 457

How to Compress a string in C++?

so I'm making an iPhone app and part of the code is in C++. I'm loading an 80mb file which is basically just a lot of text, but I notice that same file when zipped is just 17mb which would be easier to open for an iPhone. How can I compress this file and at runtime decompress and read the decompressed string?

Upvotes: 2

Views: 3618

Answers (3)

Daniel
Daniel

Reputation: 31609

You can use zlib, or a more c++ approach Boost zlib filters.

Upvotes: 4

Benedikt Bünz
Benedikt Bünz

Reputation: 646

http://zlib.net/ is a free and easy compression libary

Upvotes: 0

Johan Lundberg
Johan Lundberg

Reputation: 27078

You could use zlib,

http://www.zlib.net/zlib_how.html

There's a thread about c++ examples here:

What easy zlib tutorials are there?

Upvotes: 0

Related Questions