Do Youu KNow Of C++ for CGI Rsources?

I am new to C++ and am looking for info on replacing perl
   scripts for cgi with C++ programs....I would rather write C++ than perl for many things on our
   web servers.
Who is Participating?

Improve company productivity with a Business Account.Sign Up

MaDdUCKConnect With a Mentor Commented:
This is what I was saying.
For a start on C++, get Bjarne Stroustrup's _The C++ Programming Language_ ( and work your way through it. Get fully acquainted with output and input, different types, classes, and everything else.

Then surf to and check out the documentation there. The next thing to do is to download a good CGI library written in C or C++ and study it. You can also find such at the last site.

Finally, the following books could be of help:
(the first proposed by Answer2000)
NCSA HTML 1.1 Specifications
W3C CGI 1.1 Specifications

if you have any questions then please ask. Over the past year I have been going through the process that you are about to go through and I should know how to help you. You can find contact information on my webpage which is cited in my profile page (click my name above)...

hope this helps.
Other than arguments come in from the environment, just like perl, and
you print to stdout for the resultant html, just like perl, what do
you want to know?
vernkAuthor Commented:
Thanx for the interest b2pi....basically I'm looking to find
reference literature on the subject...pretty much anything
that will help me to I can see how to
do things like pull the info from value pairs in a form and pass it/process it, then output it,etc....I figure I should probably put the effort into the C++ rather than splitting myself between the two.  
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

are you fluent in C++?
vernkAuthor Commented:
No, just beginning.....I've been an isp for 4 years (nt3.51-4.0) and have a very narrow scope of practical knowledge....just hacked some perl scripts for a couple customers (with help from here) and have been wanting to get a basic foundation in C....the local com. college only offers C++ classes, so I'm the cherry old guy (41) in the class. I do have needs for perl like scripts, but figured i might as well write them in C++. I'm trying to get a handle on how to pass things from forms to a C++ program and back to some virtual pages that are built on the fly. Any documentation you know of is appreciated.
vernk -

1. Buy an introductory book on C++.  Browse your local books store and find the one that best suits your level of knowledge (which isn't clear from the comments you made).

2. Buy this book

The CGI Book
By William E. Weinman
ISBN 1-56205-571-2
Published by New Riders Publishing 1996

It doesn't explain C (it assumes a basic knowledge).  It will tell and show you how to write C (plus a few Perl and shell script examples mostly for comparison - but I would think this helps given your previous experience)

Quite often the book gives an example in Perl or shell script, and then the same thing in C.

Here is the review I wrote of it:

(begin quote)

This is a book I really like.  It's not flash, it's not cool, but it's packed with tons of useful information, and you won't need a Fork Lift Truck to carry it around with you.

In terms of content this book is mostly UNIX, Perl and C orientated, which will make it appear dated to some.  You won't find the latest web gadgets covered within it's pages, but you will find plenty of good advice about writing CGI programs.

Thankfully this book also avoids one of the most common pitfalls with Internet and computing books - it doesn't try to teach you everything.  As you build up your library of technology books, you'll appreciate not having yet another introduction to basic C programming or HTML.

Apart from covering the basics of creating a CGI program, the book also walks you through many related topics including processing forms, URLs (the clearest explanation I've seen yet), image maps, cookies and server side includes.

Given the current concern about Internet security, I was also glad to see an entire (and thoroughly readable) chapter about security issues with CGI, as well as a scattering of security discussions through out the book whenever an issue arises.

The only criticism that I would make concerns the quality of the source code.  While I'm sure each example program would work, and is individually clear, if used as the starting point for larger project, you could quickly get into trouble.  C programming newbies, in particular, should be aware that these are examples rather templates.  

In conclusion, this is an excellent book.  If you consider yourself a web technologist you should buy it.  Even if you consider yourself an expert, you still might find surprises in its well-crafted pages.

(end quote)

3. Another good book

ActiveX Web Programming
By Adam Blum
Published by John Wiley & Sons, Inc. 1997

This has chapters on C++ CGI and ISAPI and includes some really nice sample code.  Some of this book may not be relevant to you, but in combination with the CGI book listed in #2, this makes a great combination.

Here's a review I wrote on this

(begin quote)

If you're looking for a book containing a pretty good single volume overview of Microsoft Internet and Intranet technologies, then this is it.    

This book is well put together and well thought out.  It doesn't try and teach you everything, for example, it (happily) omits tutoring you on HTML and other web basics.  Because of this wise decision and some good editing, it manages to pack a tremendous amount of information into the 277 pages of the main text (there's about another 120 pages of Appendices as well which is mostly source code).

In general there's one chapter per topic, and topics include ISAPI, VBScript, IIS,
Perl, Java, CGI, ActiveX Server and as well as ActiveX controls. Of course each of these topics would merit a book in itself, so don't expect too much detail.  However I found that each chapter was enough for me to understand the basics of a technology, and get me started.
So what's not included, and what could be improved?

Obviously you can guess by the title, this book is strongly Microsoft focused (but not as much as you might think).  Fortunately, this book avoids the "lecturing" element you find in so many books of this kind, but still don't expect to find much on rival technologies such as those from Sun or Netscape.  

The weakest chapter is the one about Perl, frankly you won't learn Perl by reading its 26 pages - though it does make a valiant attempt.  

To some, the most serious deficiency will be that books like this, date very quickly.  The information contained within is still accurate, but you won't find any information about all the latest Internet gadgets from Microsoft.

In summary I would recommend this book without any reservation to anybody who is building a Microsoft based Intranet.  If you're targeting the Internet, then you should still seriously consider this book, but buy some others too!  

(end quote)

I hope this helps.
C++ and CGI are two different things.  What you really need to do is learn C++ first and then get ahold of a basic C++-based CGI library and you'll be in business.  Beyond that you want to get a grasp of CGI fundamentals (MIME headers, setting Cookies if necessary, etc.)  
of course I would appreciate more than _5_ points --> for just 5 points I will not be able to give you more info than what I just gave (which was a lot more than a 5 pointer anyhow)...
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.