1 00:00:00,000 --> 00:00:00,380 2 00:00:00,380 --> 00:00:02,020 >> SPEAKER 1: Let's write the first of our programs. 3 00:00:02,020 --> 00:00:05,240 We'll use a program called gedit, which is simply a graphical editor. 4 00:00:05,240 --> 00:00:08,370 Not unlike Microsoft Word, with which we can create source code. 5 00:00:08,370 --> 00:00:11,420 Let's first create ourselves a file called Hello.c. 6 00:00:11,420 --> 00:00:14,030 >> I'm going to go up to File, Save. 7 00:00:14,030 --> 00:00:16,230 Type of file name of Hello.c. 8 00:00:16,230 --> 00:00:19,390 Specify that I want to save it in jHarvard's home directory. 9 00:00:19,390 --> 00:00:20,810 And then click Save. 10 00:00:20,810 --> 00:00:24,330 Now the tab atop my file indeed confirms the files Hello.c. 11 00:00:24,330 --> 00:00:25,510 So we're on our way. 12 00:00:25,510 --> 00:00:27,540 >> Let's go ahead and write our first program. 13 00:00:27,540 --> 00:00:33,890 Sharp, include, open bracket, standard I/O.h, close bracket. 14 00:00:33,890 --> 00:00:41,330 Int, main, void, open curly brace, four spaces of indentation, printf, 15 00:00:41,330 --> 00:00:47,520 open parenthesis, open quote, hello comma world, backslash n, close quote. 16 00:00:47,520 --> 00:00:48,670 Close parenthesis. 17 00:00:48,670 --> 00:00:53,220 Semicolon, enter, backspace, backspace, backspace, backspace, and a 18 00:00:53,220 --> 00:00:55,270 closing curly brace. 19 00:00:55,270 --> 00:00:59,970 >> Not the simplest looking program but if you look closely at line five, 20 00:00:59,970 --> 00:01:01,720 that's really the essence of this program. 21 00:01:01,720 --> 00:01:05,090 Once we run this program through a compiler, thereby getting ourselves 22 00:01:05,090 --> 00:01:08,270 some zeros and ones that the computer itself will understand, we will have a 23 00:01:08,270 --> 00:01:12,220 program that quite simply prints to the screen, hello world. 24 00:01:12,220 --> 00:01:13,780 Let's now hit Save. 25 00:01:13,780 --> 00:01:16,470 >> And now let's compile this program and run it. 26 00:01:16,470 --> 00:01:18,840 To do so, we're going to use this black and white window at the bottom 27 00:01:18,840 --> 00:01:21,300 of my screen, otherwise known as a terminal window. 28 00:01:21,300 --> 00:01:25,970 And I'm literally going to type make hello to make a program called hello. 29 00:01:25,970 --> 00:01:29,720 And this program make is actually going to infer from that command that 30 00:01:29,720 --> 00:01:31,750 the file must be called hello.c. 31 00:01:31,750 --> 00:01:33,100 >> I now hit enter. 32 00:01:33,100 --> 00:01:36,350 I see a seemingly cryptic set of commands on the screen, but more on 33 00:01:36,350 --> 00:01:37,320 those another time. 34 00:01:37,320 --> 00:01:39,640 But most importantly, I see another blinking prompt. 35 00:01:39,640 --> 00:01:44,000 At this point, I can type .slash hello, enter. 36 00:01:44,000 --> 00:01:47,140 And there it is, my very first program, hello world. 37 00:01:47,140 --> 00:01:48,715