Name

gzputc Writes character to a compressed file.


Library

Libz.lib


Synopsis

#include <zlib.h>
int gzputc (gzFile file, int c);


Return Value

On success, gzputc() shall return the value written, otherwise gzputc() shall return -1.


Detailed Description

The gzputc() function shall write the single character c, converted from integer to unsigned character, to the compressed file referenced by file, which shall have been opened in a write mode (see gzopen() and gzdopen()).


Examples

To write the character 'r' to a compressed file:

#include <stdio.h>
#include <zlib.h>

void Gzputc( )
{
gzFile file;
const char * fname = TESTFILE ;
file = gzopen(fname, "wb");
gzputc(file, 'r');
gzclose(file);
}

Errors

On error, gzputc() shall return -1.


Feedback

For additional information or queries on this page send feedback

© 2008 Nokia Corporation. All rights reserved. This documentation can be used in the connection with this Product to help and support the user.

Top