Introduction to C
What is C?
C is a programming language. The C language was first developed in 1972 by Dennis Ritchie at AT&T Bell Labs. Ritchie called his newly developed language C simply because there was a B programming language already. (As a matter of fact, the B language led to the development of C.)
C is a high-level programming language. In fact, C is one of the most popular general-purpose programming languages.
In the computer world, the further a programming language is from the computer architecture, the higher the language's level. You can imagine that the lowest-level languages are machine languages that computers understand directly. The high-level programming languages, on the other hand, are closer to our human languages.
Tools you need for developing an application/program
You need a compiler, text editor and debugger.
Compiler:
A compiler is a program that lets you turn your code into an executable file that you can run on your computer. To program, you must have a compiler. (i-e: Code::Blockes, DevC++ etc…)
Text Editor:
Text editor is an application which we can right our code such as Notepad, or Notepad++, Notepad++ is good for code writing, because it can highlight the syntax of many languages.
Using a text editor you must save your file as filename.c
Debugger:
A debugger is a tool for tracking down problems with your code -- bugs -- that result in unexpected behavior of a running program ("at runtime"). A debugger will let you get inside your code -- you can run a program in a debugger and temporarily pause execution to see what line of code is being executed, the values of variables, and other information that will help you tell what your program is doing and why it isn't doing what you expect.
IDE (Integrated Development Environment):
a combination of a text editor and a compiler, such that you can compile and run your programs directly within the IDE. IDEs usually have facilities to help you quickly jump to compiler errors.
Setting up Code::Blockes
- Install Code::Blockes
- Lunch it from Start->All Programms->CodeBlockes->CodeBlockes
Window will auto detect the compiler
You will see the Code::Blockes environment
Goto
File->New->Project
And select Console application for new dialog box and press go to proceed
Click Next and you will see the Language Selection Dialog and select C
Click next and Code::Block will ask for file name and location to save the file
Again it will ask you for setup the compiler, leave it as it is and press Finish to complete creation of new C project
After pressing the finish button you will the Code::Blockes IDE
main() : out every program starts with main function, this line of code tells to compiler that your code starts from here.
{ } : the body of a function can be find in these braces.
printf(); : this function is printing out the given string or value in parentheses.
in next part you will learn about variables (What is a variable?, how to name it? And how to use it in our application).
Hope it makes sense
Attached File(s)
-
Part_I__Intorduction_to_C.pdf (325.79K)
Number of downloads: 98





MultiQuote





|