some easy questions about c++

1. is it possible to link the c++ files with databases like oracle,MySql?
(coding the file to access the databases)

2. can we put the compiled files on websites?
Google.com is build in C and C++ and their search engine is running on that. how is that possible?

some easy questions about c++

1. is it possible to link the c++ files with databases like oracle,MySql?
(coding the file to access the databases)

2. can we put the compiled files on websites?
Google.com is build in C and C++ and their search engine is running on that. how is that possible?

1. Yes. You will need an Application Programming Interface (API). I believe it comes standand with mySQL and the same is probably true for Oracle.

2. The compiled file will generate (build) the webpage on the server which is then displayed on the browser.

but the compiled file has .exe extension

how can we make that generate the webpage?

iam a bit confused cause .exe cant be browsed by browser and i dotn know how to generate the webpage on server.....

any special software?

any help/hint is appreciated

I suppose that generating a webpage means just putting stuff into a html file, just like any other file. You put HTML code in it.

If you want to write CGI programs in C or C++, and want to know how it works, read this tutorial: http://www.cs.tut.fi/~jkorpela/forms/cgic.html

This is not how Google does things, though. What do you think web servers like Apache are written in? C and C++. Google has its own software that is a specialized web server.

You should not be using C or C++ to dynamically serve your web documents, not because you can't, or for technical reasons, but because it's really much easier to use a language like PHP that's more suited for the purpose.

I think it would help if you understood a bit about how HTTP works. One computer sends a request to another, looking something like

GET /search?q=foo+bar HTTP/1.1
Host: www.google.com

Then the other computer replies with some information followed by the webpage. The computer that sends the request has no idea what the server is doing on what languages are used to write the web server, and it doesn't care.

PHP

Did I just actually recommend using PHP? Oh god no! Anything but PHP. That was just an example of what /other/ people use :-)

Did I just actually recommend using PHP? Oh god no! Anything but PHP. That was just an example of what /other/ people use :-)

Ack, I just recently skipped down to the shops and got myself a php/mysql/apache all in one book. Was that a mistake? :cry:

You're posting in the C++ forum. What do you expect? :)

Oh thanx dani, I was beginning to worry I wasted my money. Yay. :mrgreen:

This article has been dead for over six months. Start a new discussion instead.