Every once in a while I will get this urge to want to learn some C, C++. I am versed in Python and know my way around bash / Shell scripting like the back of my hand. But as always I am continuing to learn and self teaching myself is how learn the “BEST IS IS”.
Anyway let’s get to it, I wanted a program that would prompt a user for a sentence and then take that sentence and write it to a file, the program would have to create the file if it did not exist. Let me show you the code and attempt to break it down.
$ cat file_open.c
// Here we do our std library includes to allow the std::library functionality
// Here is where we declare our main function
printf("Enter a string you wish to write to a file:\n");