Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Step 1 would be to get the latest conversion rate. You can use a web-service for that. There are many available. You can try <a href="http://www.webservicex.net/CurrencyConvertor.asmx?op=ConversionRate" rel="nofollow noreferrer">this</a>.</p> <p><strong>Request:</strong></p> <pre><code>GET /CurrencyConvertor.asmx/ConversionRate?FromCurrency=INR&amp;ToCurrency=USD HTTP/1.1 Host: www.webservicex.net </code></pre> <p><strong>Response:</strong></p> <pre><code>HTTP/1.1 200 OK Content-Type: text/xml; charset=utf-8 Content-Length: length &lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;double xmlns="http://www.webserviceX.NET/"&gt;SOME_RATE_IN_DOUBLE&lt;/double&gt; </code></pre> <p>For sending the request you can make use of cURL.</p> <p>Once you have the response, just parse it to get the rate. Once you've the rate you can easily write the program to convert.</p> <p><strong>EDIT:</strong></p> <p>If using cURL is something you are not comfortable with you can make use of good old <code>system</code> and <code>wget</code>. For this you need to construct the URL first like:</p> <p><a href="http://www.webservicex.net/CurrencyConvertor.asmx/ConversionRate?FromCurrency=INR&amp;ToCurrency=USD" rel="nofollow noreferrer">www.webservicex.net/CurrencyConvertor.asmx/ConversionRate?FromCurrency=INR&amp;ToCurrency=USD</a></p> <p>then from the C program you can do:</p> <pre><code>char cmd[200]; char URL[] = "www.webservicex.net/CurrencyConvertor.asmx/ConversionRate?FromCurrency=INR&amp;ToCurrency=USD"; sprintf(cmd,"wget -O result.html '%s'",URL); // ensure the URL is in quotes. system(cmd); </code></pre> <p>After this the conversion rate is in the file <code>result.html</code> as XML. Just open it and parse it. </p> <p>If you are using windows, you need to install wget for windows if you don't have it. You can get it <a href="http://gnuwin32.sourceforge.net/packages/wget.htm" rel="nofollow noreferrer">here</a>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload