From the above example I'm guessing you want the information from file to pipe to the created myProgram not even sure if that is possible. ...."THINKING" a pipe takes output from the previous to the next so..
why not create your program to use the file you input as an argument and work on piping it in the app using scripting. you not limited but be careful.
std::vector<char> someData(10, '-'); // roughly same as char someData = "---------";
someData.back() = '\0'; // NIL-terminated, so that it's known where it ends
std::cout << someData.data() << std::endl;