Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

trying to learn C++ and some other stuff 1

Status
Not open for further replies.

mover50

Programmer
Aug 3, 2004
77
US
I want to try and code a program in C++ that will be able to access a yahoo web site to download .csv data and also work with a MySQL database and I want to do this on a linux OS.

I have extensive programming experience in other lanuages mostly on mainframe along with some PC basic. So learning the prinicples of programming is not a problem.

I am just starting to learn C++ and am going through a book that pretty much covers the basics, but no web stuff or DB stuff.

This seems like some very basic stuff and I do not understand why it is not part of the basics of learning C++. Now days, what good is a language if it cannot interface with the internet and various types of DB's.

I have been researching and googling this for about a week now and nothing hits the nail on the head.

Not sure how to form the question but I will try.

If you were going to start learning to write a C++ program and it required you to download .csv data from yahoo and to interface with a MySQL database on a linux OS, how would you do it?

BTW, I already have a linux OS (Fedora Core 2) on my PC and have been learning it and using it almost 100% of the time for about 6 mos now.

Thanks,

Kent
 
> going through a book that pretty much covers the basics, but no web stuff or DB stuff.
Nor will it teach you about operating systems, graphics, games, numerical analysis, desktop publishing or any other application which you can name.

The language itself is portable (runs on pretty much anything out there), so it really doesn't care about all the things you can use it for (and with).

The rest you have to do by either writing for yourself or locating libraries and classes which other people have already written. This is perhaps the hardest part.
It means you have a great deal of choice in how you solve a problem. You're not stuck with someone elses choice on how to solve the problem.

> how would you do it?
Step 1 - the hard way
Read to figure out how to access the network
Read to find the relevant RFC's which describe FTP or HTTP to access the site in question.
Step 1 - the easy way
Use one of several tools which come with Linux which make it easy to grab bits of the internet. curl and wget spring to mind.

Code:
// quick hack one-liner :-)
// grab a file from a site and store it locally
system("curl --silent --output file.csv [URL unfurl="true"]http://www.yahoo.com/path/to/file.csv"[/URL] );
curl even comes with a library (libcurl) which provides a programming interface if you want a bit more control over it.

As for step 2, there's really only one course of action
Scroll down to the "MySQL++ API Documentation" for that real C++ feeling.

Here's another list

--
 
Thanks Salem,
Very helpful indeed.

Where do I find out what headers/functions I have, what they do, and where they are located?

Regards,

Kent
 
Most of the stable header files are to be found in [tt]/usr/include[/tt] and most of the libraries which they relate to are in [tt]/usr/lib[/tt]

For finding out information, the apropos command searches all the manual pages for keywords.
For example
[tt]apropos logarithm[/tt]

The manual page on a specific function would then be
[tt]man log10[/tt]

Things more experimental in nature, which you might download or develop yourself would initially be in your own personal include and lib directories.

--
 
BTW, if you're interested in Internet programming, you may want to consider Java, since it has a large number of Internet libraries built into it.
There are also C++ books that specialize in certain areas like networking, multithreading, graphics... Although they usually assume that you already know the basics of C++.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top