Here are some pointers on what you're going to want to read more about to get this job done:
You will want to learn about sockets. Sockets will be your portals to the internet. These are what you will use to send and receive data from the internet. If you are on Windows, you want to check out winsock (#include <winsock2.h>). Important: You will need to link to ws2_32.lib to make this compile. If you're getting a ton of linker errors, you probably forgot to include ws2_32.lib in your project. Possible search keywords: winsock, berkeley sockets, network programming. nullterminator.net has a decent c++ tutorial demonstrating a simple client and server application using winsock (
http://www.nullterminator.net/winsock.html). You will be building a client that connects to whatever server is providing your stocks.
Once you can send and receive data from the internet, you will need to know how to speak the language of whatever service you're contacting. These languages are called protocols. If you're contacting a website for the stock information, odds are that website will use HTTP (HyperText Transfer Protocol). See "HTTP Made Really Easy" at jmarshall.com for a good tutorial on http (
http://www.jmarshall.com/easy/http/). Search for: Http, get request, post request
If you're doing this stuff for fun/knowledge, you should follow the above steps. If you're just trying to get something done for work or as quickly as possible, find a library that will do what you want. I have never used it myself, but the C++ Poco libraries include a HTTPClient object which should get you around the sockets and the http part.
Last thing I'll mention is to make sure that the stock service you're using allows you to grab their information for free. Certain services' terms of service don't allow you to write your own program to grab info from their servers (Try writing a program to search on Google without their permission, for example).