Page 1 of 1

C Part I: Introduction To C Rate Topic: -----

#1 noorahmad  Icon User is offline

  • Untitled
  • member icon

Reputation: 209
  • View blog
  • Posts: 2,290
  • Joined: 12-March 09

Posted 07 September 2009 - 03:35 AM

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
When you run it for the first time it follow the following process

Window will auto detect the compiler
Posted Image

You will see the Code::Blockes environment
Goto
File->New->Project
And select Console application for new dialog box and press go to proceed
Posted Image

Click Next and you will see the Language Selection Dialog and select C
Posted Image

Click next and Code::Block will ask for file name and location to save the file
Posted Image

Again it will ask you for setup the compiler, leave it as it is and press Finish to complete creation of new C project
Posted Image

After pressing the finish button you will the Code::Blockes IDE
Posted Image

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)



Is This A Good Question/Topic? 0
  • +

Replies To: C Part I: Introduction To C

#2 KYA  Icon User is offline

  • g++ jameson.cpp -o beverage
  • member icon

Reputation: 3101
  • View blog
  • Posts: 19,141
  • Joined: 14-September 07

Posted 08 September 2009 - 06:43 PM

This is better classified as an intro to code blocks rather then C. Code wise we don't get past hello world.
Was This Post Helpful? 0
  • +
  • -

#3 Guest_Neumann*


Reputation:

Posted 08 September 2009 - 06:47 PM

What was the point of including <stdlib.h>?
Was This Post Helpful? 0

#4 noorahmad  Icon User is offline

  • Untitled
  • member icon

Reputation: 209
  • View blog
  • Posts: 2,290
  • Joined: 12-March 09

Posted 09 September 2009 - 09:37 PM

View PostKYA, on 9 Sep, 2009 - 05:13 AM, said:

This is better classified as an intro to code blocks rather then C. Code wise we don't get past hello world.

i think we can see the code in code blockes body, and i explained the code at the end :)

View PostNeumann, on 9 Sep, 2009 - 05:17 AM, said:

What was the point of including <stdlib.h>?

in next part i will explain these all :)

This post has been edited by noorahmad: 13 September 2009 - 10:56 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1