How to compile and run C in sublime text 3?

前端 未结 12 1228
生来不讨喜
生来不讨喜 2020-11-30 20:33

I would like to compile and run C program in sublime text 3 on ubuntu 14.04. Currently the program is being compiled with gcc using sublime text 3 executing a command (see b

12条回答
  •  广开言路
    2020-11-30 21:37

    If you code C or C++ language. I think we are lucky because we could use a file to input. It is so convenient and clear. I often do that. This is argument to implement it :

    {
    freopen("inputfile", "r", stdin);
    }
    

    Notice that inputfile must locate at same directory with source code file, r is stand for read.

提交回复
热议问题