CS50 Hello World

Today we started edX coding with C. I started by making a folder called unit1, then a folder within unit1 called hello. In here I made a file named hello.c. I edited this file by writing a code that is meant to display a message. After writing the code, checked my directory by typing ls to make sure I was in my hello folder, and then typed make hello. This executed the code, creating a new file in the hello folder called hello. I checked to make sure this worked by typing ls, and hello* and hello.c came up. Hello had an asterisk meaning it can be executed. I then typed ./hello, running the executable hello file, and displaying the message "hello, world." I then changed the hello.c file code so make it say "Hi Abby!" I saved the code. I typed make code in the directory in order to change the executable file, then typed ./hello to run the code. It displayed "Hi Abby!"

The purpose of this lesson was to begin to learn how computers work using C. I mistook one of the computer's responses to a command for an error, so I learned that if  the computer gives me a message that I don't understand, it doesn't necessarily mean it's wrong. Also, after I wrote make hello a new file was created and I thought I made a mistake, but it was the computer making the code I had just written.

Comments

Popular posts from this blog

Marconi Feedback

Create Task Day 4

Create Task Day 7