Presentation is loading. Please wait.

Presentation is loading. Please wait.

Hello World C By Anand George.

Similar presentations


Presentation on theme: "Hello World C By Anand George."— Presentation transcript:

1 Hello World C By Anand George

2 Why learning C in the year 2012 or later?
Don’t underestimate C. 100% windows Kernel is written in C including Windows 8. ( bit assembly as well) C is a must to learn C++ in fact C++ is just a super set of C. 100% Linux kernel is either C or C++. What browser/software you are using to view this? IE?, Firefox?, chrome? PowerPoint? Adobe reader? Media player ? You name it ..all are written in either C/C++.

3 Then why so much hype about C# ..Java..etc?
These languages are simpler and relative easy to develop business logic. To many libraries / software are available which promotes them in web and other business scenarios. For example if you develop a web application you will never go with C/C++ but you will do with something like java/C#/php.

4 Then why cant I go with Java or C# any way I am new to all?
Those languages abstract so many things so that you wont understand the basics. It like start learning counting from the number some time you wont even understand if some one tell about 2 or 3 which is less than They will place the programmer in virtual world which is far from reality. In those languages more “doing” is happening than leaning. If you want to be a real engineer who like to know the fundamentals you will start from C and Assembly language which we are going do here.

5 Demo Hello world program in C using visual Studio.
scanf to take input from user of the program. %d, %c, %s, %x

6 What just happened? Big thing ( and very complicated in fact )
Wrote a program in C with the help of Visual Studio. Complied that program with help of complier integrated to visual studio. The complier created the CPU instruction for the program we just wrote. The OS ( windows ) loaded the above generated instructions made the CPU of the computer execute those instructions and we saw the output. ( we ignore details like linking etc for now )

7 Steps Program in Visual studio given to complier
Compiler created the equivalent CPU instruction of the program we have given. Visual Studio started the program which is the output of the complier. OS loaded the program and given the CPU instructions to CPU to execute. CPU executed the instruction and we saw the Output.

8 The main function Where the execution begins.
“{“ opening and “}” closing of a function definition. printf is a function. “hello world” is the argument to the function.

9 #include <stdio.h>
We are including something called header file. This is to make complier happy for we are using printf function. Stdio.h is called header file which a text file.

10 Bit about libraries and functions
Program is instruction to computer. In a program we cannot do everything by ourselves, just like in life we cannot do everything for example for a Car we buy a car ( and never make a car ) which is made by car company who is expert in making car. Like that many things book, computer, pen, pencil so many “things” we “buy” Like that in program we ‘call’ ( “buy” ) functions ( “things” )which is made by experts like printf we saw. But as you know some thing we do make like food, drinks so do in programming we write some functions as well which is specific to our program and fairly easy to make.

11 Library Header files sometime called a Library.
Which contains functions which can be called in our program. stdio.h in our case contains printf which we are calling in our program.

12 What exactly is our program?
Just a text file with .cpp extension. Can be opened in notepad as well.

13 Demo : Where are the other actors?
Looking at project files. And output files Demo. Executing application outside visual studio.

14 Demo How look for functions and their reference?
scanf and printf Msdn and other web sites.

15 Thank you.


Download ppt "Hello World C By Anand George."

Similar presentations


Ads by Google