It is possible to method to write a
C program to transform say
Indian Rupee (or visa-versa). The conversion parameter should not be hardcoded but dynamic. More preciously it will obtain the latest worth of
Dollar instantly(from online) ?
Step One is always to obtain the latest conversion rate. Use a web-service for your. You will find many available. You can test this.
GET /CurrencyConvertor.asmx/ConversionRate?FromCurrency=INR&ToCurrency=USD HTTP/1.1 Host: world wide web.webservicex.internet
HTTP/1.1 200 OK Content-Type: text/xml charset=utf-8 Content-Length: length <?xml version="1." encoding="utf-8"?> <double xmlns="http://world wide web.webserviceX.Internet/">SOME_RATE_IN_DOUBLE</double>
For delivering the request you are able to take advantage of cURL.
After you have the response, just parse it to find the rate. Once you have the speed it is simple to write this program to transform.
If using cURL is one thing you aren't confident with you are able to take advantage of traditional
wget. With this you have to construct the URL first like:
then in the C program that you can do:
char cmd char URL = "world wide web.webservicex.internet/CurrencyConvertor.asmx/ConversionRate?FromCurrency=INR&ToCurrency=USD" sprintf(cmd,"wget -O result.html '%s'",URL) // make sure the URL is within quotes. system(cmd)
Following this the conversion rate is incorporated in the file
result.html as XML. Just open it up and parse it.
If you work with home windows, you have to install wget for home windows without having it. You will get it here.
First, you have to look for a server that may offers the conversion rate. Next, you are writing your program to fetch the rates from that server and employ individuals information further inside your program.
This website, http://world wide web.csharphelp.com/2007/01/currency-ripper tools-server-with-c/ although supplies a tutorial for C# + Web, it can provide you with an over-all technical concept of how to get it done.