I am writing a simple CGI script to print the variables passed through the form. My form has only on submit button and i use POST method while executing the script. The script is simple:
cout << "Content-type:TEXT/HTML\n\n";
char* streamSize = getenv("CONTENT_LENGTH");
long dataSize = atol(streamSize); // convert size from char*
char* buffer = new char[dataSize]; // get some room
cin >> buffer;
cout << buffer; // just print variables
delete  buffer; //let's delete buffer
cout << "this is it";
Simple. is not it? Even more it works as a CGI script on the web (IIS 3.0) only when i commented the
delete  buffer; line. Otherwise it does not.
Is there a specific reason why?