开发者

Call command line from C program

开发者 https://www.devze.com 2023-01-28 07:44 出处:网络
I am writing an command line application in C and from within the program, I would like to call o开发者_Python百科ther command-line applications.For example (and only as a clear example!), say the I w

I am writing an command line application in C and from within the program, I would like to call o开发者_Python百科ther command-line applications. For example (and only as a clear example!), say the I would like to write a C app that calls the java compiler. For one, how would I do this? Is there a C function that directly calls the command line of something? For two, how would I take the normal text output that the java compiler displays and display it through the c program?

I'm sorry if this sounds a bit crazy, but I am very new to C and I have never done anything like this before. I would love to start writing a few of these utility style apps. If it matters any, I am currently running Windows, but would prefer a platform-independent method if possible, as I do use Linux from time to time.


You might look into system. I think you can use it in Windows as well as UNIX/Linux systems.

0

精彩评论

暂无评论...
验证码 换一张
取 消