I'm in a coding competition where I upload my code to the competition host's platform to be compiled and run. The host then supplies my program with data to work on, through stdin
. My code uses scanf("%u", &data)
to grab this data.
Before I upload my code to the competition though, I have a chance to test it on my own platform. I'd like my program to supply itself with problem data
that I wrote myself and gather this data using the same scanf()
code.
I'm writing my test data in a string, located in the same program that needs to grab it using scanf()
. Is this possible at all, or do I need to change where or how I'm creating the test data?