Run the C language program and save the result to the file.

Source: Internet
Author: User

Previously, when I mentioned saving the running result to a file, I naturally thought of the method of reading the file in C language. However, this is difficult for beginners.

">

Yesterday afternoon, the teacher taught us a trick. After the C language program is compiled, We will compile it into a. object file, and then link it to generate the. exe executable file. However, we generally run this program directly in the compiling environment. Of course, we can also run executable files in the form of command lines (I think everyone knows this ).

The following describes how to save the running result in a file.

This figure shows the method. Sorted. EXE is my executable file. "> Out.txt indicates that the execution result is stored in the out.txt file under the current directory. ">" Means to overwrite or overwrite the object, and ">" means to append the object.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.