I originally used GetFileSize() and then found out that is not the correct way to go. Please give me some suggestions.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
When you launch a process, you will get an output stream (assuming you have redirected its standard output). A proper way of dealing with streams is to read it by chunks, multiple times untill you reach end of the stream. A sample code is on MSDN page — look for function ReadFromPipe(void). Here is the copy of the code:
If you do need to aggregate the entire stream into one buffer, you can use dynamically allocated containers, e.g. std::vector, std::string, std::list, etc.