Yes, it's quite easy to do in C++, just read the file one character at a time, each will be 8 bits, and then you loop over each bit testing if it's 1 or not, and output '1' or '0' accordingly. Here's a simple function to convert a text string to binary:
for (int i=0; str[i]; i++)
for (unsigned char bitmask=0x80; bitmask; bitmask>>=1)
putchar((c & bitmask) ? '1' : '0');
To convert this for your needs, read characters from the .jpc file instead of str (fgetc()), and output (fputc()) the 1s and 0s to the file to be encoded with LDPC. The spaces and newline are just there to make the screen output clearer; you wouldn't output these. You'll need fopen and fclose as well.