Thread: CGI scripts in c/c++ ?

  1. #1
    Unregistered
    Guest

    CGI scripts in c/c++ ?

    Hello, I was wondering if it possible to write a CGI script in C/C++ ? Would it be something like this:

    ==================
    #(path the perl)

    cout << "hello world!";
    ==================

    That would'nt work though would it, if it is possible to write a CGI script in C/C++, please could someone show me a hello world! example, thanks.

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    Actually, if I'm not mistaken, you can write CGI scripts completely in C and quite a few of the ones out there are done this way. I'm not sure about the interface to get it to run on the net as I've never done one though.

    -Prelude

  3. #3
    * Death to Visual Basic * Devil Panther's Avatar
    Join Date
    Aug 2001
    Posts
    768

    Cool EXTRA!!!

    What Prelude just said, is correct, but he forgot to tell you one small, yet important part:

    You need to compile the c/c++ code first, with gcc (on Unix/Linux machine of course, because i never saw a site running on windows(with iis server) using cgi), and then rename the file's type (*.out) to *.cgi and voilla you just wrote a cgi script in c/c++.

    I only tried that with c, and never c++, but i guess it's the same!
    "I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe

    http://www.Bloodware.net - Developing free software for the community.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. about cgi scripts
    By xixpsychoxix in forum Networking/Device Communication
    Replies: 11
    Last Post: 07-08-2008, 06:03 PM
  2. Can C++ be used to create server scripts like php or cgi?
    By joeprogrammer in forum Tech Board
    Replies: 10
    Last Post: 03-16-2006, 09:26 PM
  3. C++ for CGI scripts
    By sean in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 01-03-2003, 10:53 AM
  4. Free web host compatible with C cgi scripts
    By Granger9 in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 12-30-2002, 11:20 AM
  5. how do I test my CGI scripts on my computer?
    By compjinx in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 09-26-2001, 05:57 PM