Hi. i'm new to the forum and am new to c++. I am looking to work on some programs while waiting for classes to open up at my CC.
I have an idea for a stock trading database. Basically I would create a "Stock" class that would have a string for a ticker and one for name, a few doubles for stock prices.
This isn't something I am trying to make money off of just a program i can use to work on to hone in on some developing programming skills.
My question: how can I include a site, or some reference, that would update teh stock price every time I run the program?
Say for example, I add GOOG for google. stock is at 21.89 at beginning of day when i run program then it jumps up a point at midday so when i run it again, my program grabs that new data and update my GOOG stock price to 22.89.
If the source is a http-page or similar, you simply open a http-connection (TCP socket), fetch the page (HTTP), and parse the important numbers out of it. You should use existing add-on libraries for the networking code. Perhaps look at source code (e.g. wget) that does something similar.
So from what I've read so far on this I could use wget to take teh data from the site example system("wget www.google.com/index.html -q");
But I am reading that that only save the data to a file how can i take that file and sacn for the stock price and use that price as a new double in my "Stock" class? Thanks for your help.