[MUSIC PLAYING] ZAMYLA CHAN: Hello, world. Let's make our first C program. To write our programs, we'll be working in the CS50 Appliance. It's a virtual machine that runs a computer inside your computer. This has a lot of benefits. For one, it's already set up with a lot of tools and you'll need for CS50. It also means that whether you have Mac, PC, Linux, everyone's using the same thing. If you haven't downloaded the CS50 Appliance yet, go to manual.cs50.net/appliance. I have my Appliance here full screen, but you can also have it as a floating window, if you wish. I highly encourage setting up a dropbox account for all of your CS50 course work. That way, in case something happens with your computer or the Appliance, you have a backup in the cloud. Let's open our terminal first. The terminal is an interface that we can use to navigate around our computer, write, compile, and run code. We'll actually write most of our code in gedit, though. So let's bring this up now. It'll bring us to an unsaved document. Notice that I start typing my C code-- there isn't any syntax highlighting. Syntax highlighting helps us visually by coloring data types, functions, and variables differently. So let's save this program into a folder, and call it hello.c. This way, we'll have syntax highlighting as we type. We'll start by including two libraries-- include cs50.h and include stdio.h. This way, our program will have access to the functions inside the CS50 Standard I/O library. Each program needs a main function, so let's write that here-- main(void) with two curly braces. And now here is where you'll write your program. For our first program, we'll just have one line printf, hello, world! With a new line right here for aesthetics. Once I save, I want to run my program. So I'm going to open my terminal now. I start go out in my home directory, but to access hello.c, I need to be in the same directory or folder. So at this prompt right here, I'm going to type cd-- change directory-- Dropbox/2013/walkthroughs. And now I'm in my walkthroughs folder. Say I forget what my folders are called. Then I'll type ls, which will list all of the files in this current directory. So changing directories a few times more, I find hello.c. And this process is analogous to navigating through Finder on Macs or My Computer in Windows. In fact, I can even make folders or directories right from the terminal with the Make Directory command, mkdir. If you want to remove a file, you can remove it from the terminal with rn, followed by the name of the file you want to remove, and typing y for yes when the terminal asks you to confirm the deletion. Be sure to explore terminal. There are tons of keyboard shortcuts to help you out. Also, gedit actually has a small terminal at the bottom here where you can do the same things we did in our bigger terminal. For now, let's compile our code with the following command-- make hello. Now you should see a line with a bunch of commands. Make is essentially a wrapper that just sends a list of commands to the terminal when you type in that one word. In this case, it's running clang, a compiler with a set of instructions-- flags-- on how to compile the program. Now that we've compiled hello.c, if we ls, we should see an executable file called hello in our directory. We run it by typing ./hello, and there's our program output. Hello, world. My name is Zamyla, and this is CS50.