Some very juicy tid bits here! I have finally changed to a C compiler, which solved the problems. Thanks to all!

I'll be using anduril462's way because it is easier to understand.

There is only one problem, both ways of output order does not matter. I need one that doesmatter (because of enantiomers). I am going to tinker with the code to see if I could make it do it, but if there is already a person who made this it would be appreciated for them to post it for me to save time :P

Code for anyone interested:
Code:
#include <stdio.h>
#include <stdlib.h>

#define N_ELEMENTS 13
/*
PROBLEM for later = Order does not matter, need to make it so it does
*/


    char *elements[N_ELEMENTS] = {"H", "B", "C", "N", "P", "O", "S", "Se", "F", "Cl", "Br", "I", "F"};
    int a, b, c, d, e;

    void write_File(char** elements, int a, int b, int c, int d, int e);


int main()
{


    for (a = 0; a < N_ELEMENTS - 5; a++)
    {
        for (b = a + 1; b < N_ELEMENTS - 4; b++)
        {
            for (c = b + 1; c < N_ELEMENTS - 4; c++)
            {
                for (d = c + 1; d < N_ELEMENTS - 4; d++)
                {
                    for (e = d + 1; e < N_ELEMENTS; e++)
                    {
                        printf("%s %s %s %s %s\n", elements[a], elements[b], elements[c], elements[d], elements[e]);
                        write_File(elements, a, b, c, d, e);
                    }
                }
            }
        }

    }

    return(0);
}


void write_File(char** elements, int a, int b, int c, int d, int e)
{

	FILE* fts;

	fts = fopen("data.dat", "a");

	if (fts)
	{
		fprintf(fts, "%s %s %s %s %s\n" , elements[a],  elements[b], elements[c], elements[d], elements[e]);
		fclose(fts);
	}


	else
	{
		printf("Error writing to file!\n");
	}

}