Horje
c read file into string Code Example
c read file into string
char * buffer = 0;
long length;
FILE * f = fopen (filename, "rb");

if (f)
{
  fseek (f, 0, SEEK_END);
  length = ftell (f);
  fseek (f, 0, SEEK_SET);
  buffer = malloc (length);
  if (buffer)
  {
    fread (buffer, 1, length, f);
  }
  fclose (f);
}

if (buffer)
{
  // start to process your data / extract strings here...
}




C

Related
curl cpp Code Example curl cpp Code Example
volatile keyword in c Code Example volatile keyword in c Code Example
time random c Code Example time random c Code Example
how to compile and run a program in c Code Example how to compile and run a program in c Code Example
c read file content Code Example c read file content Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
11