#Mastery01 #MASTERY01

01  01

I am doing this mastery again because i want to get the two points.

Well in this one I want to teach how to create and run a c++ from command line.

Im going to give you a couple of steps to make it easier to you to understand it:

     1.- Open your editor (notepad, notepad++, sublime, jeditor, etc..).

     2.- Save your program as a c++ file and in the end of the name add “.cpp” so the terminal will run it.

     3.- Start coding. 

          3.1.- Include your libraries, ALWAYS include (#include , ) the cstdlib is not always             necessary but add it anyway.

          3.2.- Before everything put “usingnamespace std;” so you don´t have to put it all over your code.

          3.3.- You will always have a “int main()” it doesn´t matter if you have functions or not.

          3.4.- ALWAYS at the end of the “int main()” put ” return 0;” is not really necesary eaither but every programmer             will tell you to put it.

     4.- Open your ternimal (cygwin, mac, linux, etc..) wait until it recognize your computer and then put “cd” to change        directory then put “/” to go were ever is your code you made in your editor.

     5.- Finally after it compiles you have to execute it with “./a.exe” in wondows, “./a.out” on Mac an Linux.

 

Hope you understand and learn from it.

CC BY 4.0 #Mastery01 #MASTERY01 by Juan Carlos is licensed under a Creative Commons Attribution 4.0 International License.

Comments are closed.