Create bitcoind_RPC.c

char *bitcoind_RPC(int numretries,char *url,char *userpass,char *command,char *args)

easy to use C library to call bitcoind and forks. For localhost usage url will be "127.0.0.1:<port>" where port is the port used by the daemon. userpass is the "rpcusername:rpcpassword" from the bitcoin.conf file.

numretries is the number of times the the RPC command is retried if there is an error. The JSON text is returned.

bitcoind_RPC(3,"127.0.0.1:8332","user:password","getinfo",0);  // is like "bitcoind getinfo"
bitcoind_RPC(3,"127.0.0.1:8332","user:password","getrawtransaction","<txid>");

If the last three fields are zero, you can even use it to make NXT API calls as long as you construct the url field to have all the required fields:

bitcoind_RPC(3,"http://127.0.0.1:7876/nxt?requestType=getState",0,0,0);

Hopefully this file will save you a frustrating day of fiddling with bitcoind RPC calls

James