Sunday, May 31, 2009

Read Text File into String Variable

#include

void ChilkatSample(void)
{
HCkFileAccess fac;
const char * fileText;

fac = CkFileAccess_Create();

// Reads the entire contents of a text file into a string variable.
// The 2nd arg specifies the character encoding used for
// the contents of the text file.
fileText = CkFileAccess_readEntireTextFile(fac,"hamlet.xml","utf-8");

printf("%s\n",fileText);

CkFileAccess_Dispose(fac);

}

No comments:

Post a Comment