httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vincent Bray" <nood...@gmail.com>
Subject Re: [users@httpd] How can I write a cgi using c/c++?
Date Tue, 10 Jul 2007 06:27:32 GMT
On 10/07/07, ying lcs <yinglcs@gmail.com> wrote:
> Can you please tell me what is the easiest way to write a cgi using c/c++?
> I am coming from Tomcat servlet environment,  I would like to know how
> can I do a cgi using c/c++ in apache?

C:

#include <stdio.h>
int main (void)
{
  printf("Content-Type: text/html\n\n");
  printf("Hello, world"):
  return 0;
}

C++:

#include <iostream>
int main (void)
{
  cout << "Content-Type: text/html\n\n";
  cout << "Hello, world";
  return 0;
}

Is that what you meant, or do you have a meaningful question? The
point is, there's no difference in CGI writing in any particular
language, you just have to know how to interogate the environment
variables, stdin & stdout.

http://hoohoo.ncsa.uiuc.edu/cgi/

-- 
noodl

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message