NOTE: I\'ve seen the post What is the cin analougus of scanf formatted input? before asking the question and the post doesn\'t solve my problem here. The post seeks for C++-
Based on @tmyklebu's comment, I implemented streamScanf which wraps istream as FILE* via fopencookie: https://github.com/likan999/codejam/blob/master/Common/StreamScanf.cpp