In this simple little practice project I am doing to teach myself a little C++, my program skipping the first word to be output to the file, and then writing the next four characters, followed by nothing. I'm not sure what I'm doing wrong here. Anybody have any clue what's going on here?

Code:
/* Practice project in C++, a command line HTML editor. Project
started on Jan. 27, 2013 at 12:18 AM. Yeah, I'm an owl. */


#include <iostream>
#include <fstream>
#include <cstdlib>
#include <string>

using namespace std;

int main()

{
    int count=0;
    int sheaderleng;
    string sheader;

    /*Here, the program asks the user to enter what the header will be
    for the title header that is to be used.*/
    cout<<"Enter header text.\n";
    cin>>sheader;
    
    //convert the string into a character array so that getline can accept it.
    
    sheaderleng=sheader.length();
    char header[sheaderleng];
        do
            {
                header[count]=sheader[count];
                count++;
            }while(count<=sheaderleng);
    
//Write data to file.
    
    cin.getline (header,sheaderleng);
    ofstream outt("File1.html");
    outt<<"<html>"<<"\n"<<"<h1>"<<header<<"<h1/>"<<"\n"<<"<html/>";
    outt.close();

//Finish program.

    return 0;
}