Good afternoon and welcome.
I wanted to show you some legacy C. Now some C compilers use the old standards which means there's more
rules that you have to follow.
And they were removed and replaced.
Better standards.
So for example in certain versions of the C language you will have an error or a warning if you define
variables underneath function calls or even if statements.
Now in old style C variables have to be declared at the top.
They have to.
So that's an important thing to know right there.
How you get around this with that with an old compiler as you can do things like this.
So by putting those two races anything you define here will count as a new scope.
So it will work.
The same applies for if statements.
So this would be legal but this would not.
So the new scope basically resets the rules and allows you to define variables at the start of the scope
but it has to be at the top of the scope.
So that's basically an important role in old style C is that variables have to be declared at the top
of the scope.
So it makes you remember that there's ways to get around these rules which I'll show you later in a
moment.
The next thing I want to show you is I showed you four loops recently right on certain versions of C.
You can't do it like this.
You have to instead do it like this.
I know it's quite silly right.
That's why it was replaced with a better standard in the newer versions of C.
You can you can do it like that and there's no problem.
So if you wanted to be able to access new functionality in your compilers complaining you could always
try and change your standard on the compiler.
If it's a modern compiler it might be used in older versions by default.
So I she had to do that now when you go to compile your program you essentially go to compile like normal
and then you do FTD for standard C standard basically equals C 11 and that should push you back up to
the new standards.
However if your compiler is legacy it might not know about standard C eleven in which case look for
the highest standard for your compiler you can add or or or replace your compiler with a complete new
one.
So yeah that I hope that covers legacy C because I was quite important to get across.