What piece of code would allow me to check if a block has been found then run an operation? I am relatively new to C++ and I was wondering if anybody could help me out. I am looking piece of code that will loop until a block is found by a node and then when one is found print a simple output like "Block found". 

Thanks!
You could simply record the value of bitcoind getblockcount somewhere and see when that changes by calling getblockcount repeatedly.