Uploaded by sankar narayana sahu

c programming

advertisement
C is an awesome programming language and it 's actually one of the oldest programming languages
around in fact. A lot of modern programming languages are based off of C so it is a really good idea if
you want to get into C or even if you 're trying to get. into something like C++ to learn the basics. In
this course, we 're gon na cover everything you need to know about the C programming language.
We 're gon na basically download and install a special program that will do that for us. So let 's get
started I am going to come over to my web browser and I 'm just gon na go up to the Google search
bar. So just type in Code blocks C. and this link should come up. This is an integrated development
environment. In this tutorial I 'm gon na talk to you guys about getting everything set up to start
programming in C on OS X. We 're actually going to use the text editor to write our C programs in and
you can use any text editor that you want to write C programs. In the next few tutorials we 're gon na
be learning about setting up code blocks writing our first C programs and really just getting started
with C
You need to get that C. compiler working so once you run that Xcode select command just type in CC V again and You should be getting this version number Alright, so now that we have our C. compiler
installed What we want to do is download an. IDE So we. want to download a special text editor that
we can use to write our C programs in. We 're gon na be doing is creating a console application This
is like there 's a basic C project that you can run on your computer. That 's exactly what we need So
click on console application and then click go and I 'm just gon na click through this wizard and you 'll
see over here. It says C++ or C now C and C++ are both Different programming languages for this
course. In this tutorial I 'm going to talk to you guys about the basics of writing a program in C. The
purpose of this tutorial was just to get our C project set up and to test our main dot C file. We 're
essentially telling code blocks to run this file and execute the program So as long as everything works
here and you 're good to go and now we can start really learning how to program.
In C we can actually write out a bunch of instructions for the computer and then we can run our
program so we can tell the computer to Execute those programs. A method is just like a container
where we can put some of our code and this method main is very important because this is the
method that 's going to get executed when we run our programs. C is a set of instructions that when
executed correctly will result in the computer doing something for us. C is one of the best languages
to program computers to do anything with C. and run it just to see what Happened , you know ? see
how your program did So we have this option over here called build and run and this will both build
your program and run. C is really the only instruction that we know which is printf so why do n't we
use this printf ? Instruction in order to draw out a little shape onto the screen. As we go forward and
we learn how to write in C We 're gon na learn more and more complex instructions and we 'll be
able to use all those instructions in conjunction with each other.
In this tutorial I want to talk to you guys about variables in C. A variable is a container where we can
store different pieces of information so different data values we could sort of things like numbers or
texts or characters. These variables make it a lot easier for us to keep track of and manage all the
data in our programs. We basically have two pieces of data that we 're working with Consistently in
this program the characters age and the character 's name. If I was to run this program then all that
information will be updated and we 'll have new story. I would have to go through and manually
change it in every single location that would take forever and it would be a huge track. I 'm gon na
get into the different data types that we can represent and see more in the next tutorial. In C we can
also store instead of just storing like one single character we can store a bunch of characters and that
would be kind of like you know a name. So to do that , I 'm just gon na type out char just like that and
that 'll basically tell C Hey , we 're gon na store characters inside of this variable.
Download