Web Hosting Talk







View Full Version : C/C++ question


exasko
11-08-2002, 01:25 AM
Hello,

I know a litte C++ and a great deal of C, I am just wondering I seen other poeple say you can put it on a website, I am just curious to know how do you do that?

Same with Visual Basic, how would I go getting that on the web site too?

If you could answer this I would be grateful. Thank you

Isaac

MarkIL
11-08-2002, 09:08 AM
Did you mean to ask if C++ can be used as a CGI executable? In that case, yes. Check this URL (http://hjs.geol.uib.no/CplusPlus/).

BiaSecurity
11-09-2002, 07:09 PM
if you are sure you want to use c\c++ to create cgi's you should take note that all of the security problems that are inherent with the langs come as well. so just be careful mate :) and good luck besides the security risk it should be fun

kilroy99
11-09-2002, 09:01 PM
As others have said, CGI is the way to get C/C++ code running from you web site. You can also run VB via CGI. C++ and VB can also create COM objects which get registered on the Windows server and then you can call their methods via ASP and/or other scripting languages. Unless you are managing your own servers, your hoster will have to register your COM objects for you.

Now if you go the MSFT .NET route, then you no longer have to register COM objects. I prefer the .NET languages and features to COM.

And as others have mentioned, when doing CGI and COM you need to be mindful of security. .NET too, but the CLR takes care of a lot for you.

My two cents.
fp

Radix
11-10-2002, 03:32 PM
VBscript ;)

Bulldog
11-10-2002, 06:19 PM
In general you want to use a language designed for server-side stuff.
C/C++ CAN be used for SS programming but why would you when you could use VB.net, ASP, PHP or ColdFusion?

cperciva
11-12-2002, 12:04 PM
Originally posted by Bulldog
C/C++ CAN be used for SS programming but why would you when you could use VB.net, ASP, PHP or ColdFusion?

Performance.

Bulldog
11-12-2002, 09:45 PM
Absolutely, if you're programming an enormous project where performance is a major issue.

Otherwise it isn't worth the hassle.

jtrovato
11-13-2002, 05:57 PM
Why not program it in RPG or Cobalt.... Just kidding.

I love C, C++ and how it works. Too bad it is definitely a hassle to use with the web...

Since you want to use c why not PHP they are very similar.

Sh0t
11-14-2002, 01:03 AM
php is most likely going to be faster anyway.

Acronym BOY
11-14-2002, 01:31 AM
Originally posted by Sh0t
php is most likely going to be faster anyway.

No, C is faster. Thats already been stated:

You could implement part of the script in C, and then call the program from your script to make it run faster. PHP is a parsed language, meaning that there are no compiled binaries. Every time a someone requests a page with PHP-code, the parser looks through the page and executed any PHP-statements it might find. Fortunately this is a very fast process, but you might want to speed things up if you have a very complicated script.

When you make a C-program, you compile the source and then run the resulting binary. This makes PHP slower that an equivalent C-program.

C is faster. Faster than Java, than PHP, than VB (plus C gives you pointers).

jtrovato
11-14-2002, 01:51 AM
that's a valid point there sir. I must agree with you.

Even though it would be easier with PHP, i would have loved to have done everything in C++.

Me Big FaN of C++

jtrovato
11-14-2002, 01:53 AM
Actually, if you need something faster you could write it in

Assembly... But it think this would be a **bit** much.

Sorry it has been a long day and I do need lots of sleep.

Acronym BOY
11-14-2002, 02:54 AM
But who honestly writes assembly? :stickout:

Besides, don't you know real programmers use Fortran (http://www.pbm.com/~lindahl/real.programmers.html)?

jtrovato
11-14-2002, 11:29 AM
Right On!!!!

cperciva
11-14-2002, 11:39 AM
Originally posted by Acronym BOY
But who honestly writes assembly? :stickout:

I do... come to think of it, I've written some cgi scripts partly in assembly language.

Besides, don't you know real programmers use Fortran (http://www.pbm.com/~lindahl/real.programmers.html)?

Maybe in this decadent era of Lite beer...

jtrovato
11-14-2002, 02:45 PM
I do have to admit I was one of those 80's kid who had the Commodore 64 running basic (go to sub , return) and Apple IIe running C on a 40/24 screen of GREEN... I thought I was cool that I could create a sprite.... and crack summer games..


I do not like lite beer.. lol

Computers are so fast these days that for the avg web site or desktop application, almost any language would do. It’s what ever you prefer or what would work for your app.

I don’t think I would or even could use Pascal for a web based app.

Have a lovely day all..