Il 13/12/10 22.18, Jean-Francois ha scritto:
Hello,

Sorry for posting basic question here, would you please let me know why such
script does'nt work (error with "Premature end of script headers") ?


#include<iostream>
using namespace std;

int main()
{
cout<<  "Content-type: text/plain"<<  endl<<  endl<<  "Hello, World!";
}


It actually shows flush needed on google but I'm not able to do a hello world
CGI in C++.

Thjanks for your help,

Reagrds

I want to help you and you can recyle it thousand times :)

#include <iostream>
#include <cstdlib>

using namespace std;

void
headers(string content="Content-Type: text/html")
{
//      string result="Content-Type: text/html";
        cout<<content<<"\r\n\r\n";
}

int main(int argc, char** argv)
{
    headers();
    cout << "Hello world" <<endl;
    return EXIT_SUCCESS;
}

Reply via email to