We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Codecast: https://codecast.france-ioi.org/v6/editor?base=https%3A%2F%2Ffioi-recordings.s3.amazonaws.com%2Fdartmouth%2F1540580685351
1 00:00:00,000 --> 00:00:00,300
2 00:00:00,300 --> 00:00:02,970 INSTRUCTOR: You may have noticed that although we haven't really
3 00:00:02,970 --> 00:00:06,810 explained to you yet all pieces of our programs, most of them
4 00:00:06,810 --> 00:00:08,960 have the same structure.
5 00:00:08,960 --> 00:00:12,210 And it is this structure that I want to explain to you a little bit more right
6 00:00:12,210 --> 00:00:12,710 now.
7 00:00:12,710 --> 00:00:14,640 And I'll put some comments into this code
8 00:00:14,640 --> 00:00:16,980 to help you see what this structure is.
9 00:00:16,980 --> 00:00:19,170 Most of our programs start with this pound sign
10 00:00:19,170 --> 00:00:23,380 include stdio.h in these angular brackets.
11 00:00:23,380 --> 00:00:26,195 That's called a preprocessor directive.
12 00:00:26,195 --> 00:00:30,160
13 00:00:30,160 --> 00:00:35,310 And it's a directive that is really meant for the preprocessor, which
14 00:00:35,310 --> 00:00:37,890 is something that happens before the compiler actually
15 00:00:37,890 --> 00:00:39,360 starts translating your code.
16 00:00:39,360 --> 00:00:42,850 We'll understand this in much more detail much later.
17 00:00:42,850 --> 00:00:46,140 For now, we just know, here are the preprocessor directives.
18 00:00:46,140 --> 00:00:49,690 Then right here, our main function starts.
19 00:00:49,690 --> 00:00:52,930
20 00:00:52,930 --> 00:00:56,770 Every program has to have a main function, just like this one right
21 00:00:56,770 --> 00:00:57,460 here.
22 00:00:57,460 --> 00:01:00,620 We will later on see that we can have more than one function.
23 00:01:00,620 --> 00:01:02,620 But know, only one of them can be called main
24 00:01:02,620 --> 00:01:06,340 and there has to be one that is called main, so that's typically right there.
25 00:01:06,340 --> 00:01:15,096 Then, inside a function, we always have some variable declarations at the top.
26 00:01:15,096 --> 00:01:17,720 Even though we haven't talked about variables here, so for now,
27 00:01:17,720 --> 00:01:20,930 that's just a word, but we'll understand this soon.
28 00:01:20,930 --> 00:01:26,630 Then, further down, we have executable statements.
29 00:01:26,630 --> 00:01:28,430 So far, we have focused on those and trying
30 00:01:28,430 --> 00:01:30,170 to understand what these statements do.
31 00:01:30,170 --> 00:01:33,650 So we have the for loop here that repeats three times.
32 00:01:33,650 --> 00:01:36,800 And then we have these printf statements that print something out.
33 00:01:36,800 --> 00:01:41,160 And finally, our function will always end with a return statement.
34 00:01:41,160 --> 00:01:45,145
35 00:01:45,145 --> 00:01:47,020 There's always going to be a return statement
36 00:01:47,020 --> 00:01:50,710 at the end of all of our functions.
37 00:01:50,710 --> 00:01:53,630 Those are the major structural parts of the programs
38 00:01:53,630 --> 00:01:58,560 that we'll be writing for now and most of our programs have these.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Codecast:
https://codecast.france-ioi.org/v6/editor?base=https%3A%2F%2Ffioi-recordings.s3.amazonaws.com%2Fdartmouth%2F1540580685351
1
00:00:00,000 --> 00:00:00,300
2
00:00:00,300 --> 00:00:02,970
INSTRUCTOR: You may have noticed
that although we haven't really
3
00:00:02,970 --> 00:00:06,810
explained to you yet all pieces
of our programs, most of them
4
00:00:06,810 --> 00:00:08,960
have the same structure.
5
00:00:08,960 --> 00:00:12,210
And it is this structure that I want to
explain to you a little bit more right
6
00:00:12,210 --> 00:00:12,710
now.
7
00:00:12,710 --> 00:00:14,640
And I'll put some
comments into this code
8
00:00:14,640 --> 00:00:16,980
to help you see what this structure is.
9
00:00:16,980 --> 00:00:19,170
Most of our programs start
with this pound sign
10
00:00:19,170 --> 00:00:23,380
include stdio.h in
these angular brackets.
11
00:00:23,380 --> 00:00:26,195
That's called a preprocessor directive.
12
00:00:26,195 --> 00:00:30,160
13
00:00:30,160 --> 00:00:35,310
And it's a directive that is really
meant for the preprocessor, which
14
00:00:35,310 --> 00:00:37,890
is something that happens
before the compiler actually
15
00:00:37,890 --> 00:00:39,360
starts translating your code.
16
00:00:39,360 --> 00:00:42,850
We'll understand this in
much more detail much later.
17
00:00:42,850 --> 00:00:46,140
For now, we just know, here are
the preprocessor directives.
18
00:00:46,140 --> 00:00:49,690
Then right here, our
main function starts.
19
00:00:49,690 --> 00:00:52,930
20
00:00:52,930 --> 00:00:56,770
Every program has to have a main
function, just like this one right
21
00:00:56,770 --> 00:00:57,460
here.
22
00:00:57,460 --> 00:01:00,620
We will later on see that we
can have more than one function.
23
00:01:00,620 --> 00:01:02,620
But know, only one of
them can be called main
24
00:01:02,620 --> 00:01:06,340
and there has to be one that is called
main, so that's typically right there.
25
00:01:06,340 --> 00:01:15,096
Then, inside a function, we always have
some variable declarations at the top.
26
00:01:15,096 --> 00:01:17,720
Even though we haven't talked
about variables here, so for now,
27
00:01:17,720 --> 00:01:20,930
that's just a word, but
we'll understand this soon.
28
00:01:20,930 --> 00:01:26,630
Then, further down, we
have executable statements.
29
00:01:26,630 --> 00:01:28,430
So far, we have focused
on those and trying
30
00:01:28,430 --> 00:01:30,170
to understand what these statements do.
31
00:01:30,170 --> 00:01:33,650
So we have the for loop here
that repeats three times.
32
00:01:33,650 --> 00:01:36,800
And then we have these printf
statements that print something out.
33
00:01:36,800 --> 00:01:41,160
And finally, our function will
always end with a return statement.
34
00:01:41,160 --> 00:01:45,145
35
00:01:45,145 --> 00:01:47,020
There's always going to
be a return statement
36
00:01:47,020 --> 00:01:50,710
at the end of all of our functions.
37
00:01:50,710 --> 00:01:53,630
Those are the major structural
parts of the programs
38
00:01:53,630 --> 00:01:58,560
that we'll be writing for now and
most of our programs have these.
The text was updated successfully, but these errors were encountered: