You seem not to understand the concept of client-server
Your program would play the client role
that requests some data from the server
The client requests
data from the server.
The server returns a resopnse
(error or success plus resuested data).
In order to successfully talk to each other, both roles must agree on some communication protocol
The request protocol
is encoded in the URL plus some additional data sent to the server.
The response protocol
is based on the protocol mentioned in the requestng URL plus the additional data sent to the server.
See HTTP Protocol
] for some background on HTTP communication between client and server.
To implement a web client, you may work on the bare low level functions, or depending on your environment (Windows, Linux, Unix, ...) you may use some existing classes/libraries.
Unix/Linux: see e.g. http://www.binarytides.com/server-client-example-c-sockets-linux/
] for C based server/client code example.
CURL: or you might use the libcurl, see http://en.wikipedia.org/wiki/CURL
CP: you might also use some already invented client, e.g. A Fully Featured Windows HTTP Wrapper in C++
Or on Windows/.Net, you might use http://msdn.microsoft.com/en-us/library/system.net.webclient(v=vs.110).aspx