mining theory – How create / generate a coinbase transaction for a new block?


I am coding a miner program with C, and right now I need some info of how create / generate a coinbase transaction to add to the block before submit it to the bitcoin network. Someone can indicate any article / tutorial explaining this (i am searching for this for a while now, and finding nothing useful of this sorts).