create example of c opening editor on template file –

For example, if you type “git commit” with no “-m” it will pop open vim and let you type the commit message . git does this by creating creating a file that has the basic content, opening editor on that file with the fork & execp command in C++, and when the editor quits and the file has been changed, git proceeds with the commit, and if the file was not changed, it does nothing; which editor program to execute depends on the contents of the user’s EDITOR environment variable, and if that’s not set, then it just defaults to nano (for example).