You are on page 1of 5

‫لیکچر نوٹ‪1 :‬‬

‫سی کا تعارف‬
‫سی ایک پروگرامنگ زبان ہے جو ‪ 1972‬میں امریکہ کے اے ٹی اینڈ ٹی کے‬
‫بیل لیبارٹریز میں تیار کی گئی تھی‪.‬‬
‫اسے ڈینس رچی نامی شخص نے ڈیزائن اور لکھا تھا‪.‬‬
‫ستر کی دہائی کے آخر میں سی نے اس وقت کی زیادہ واقف زبانوں کی جگہ‬
‫‪ PL / I ، ALGOL‬وغیرہ کی جگہ لینا شروع کردی۔‬
‫اے این ایس آئی سی کا معیار ‪ 1980‬کی دہائی کے اوائل میں سامنے آیا ‪ ،‬اس‬
‫کتاب کو دو عنوانات میں تقسیم کردیا گیا‪:‬‬
‫اصل کو ابھی بھی سی میں پروگرامنگ کہا جاتا تھا ‪ ،‬اور اے این ایس آئی سی کا‬
‫احاطہ کرنے والے عنوان کو اے این ایس آئی سی میں پروگرامنگ کہا جاتا تھا‪.‬‬
‫یہ اس لئے کیا گیا تھا کہ مرتب کرنے والے دکانداروں کو اپنے اے این ایس آئی‬
‫سی کمپلرز کو رہا کرنے میں کئی سال لگے اور ان کے لئے ہر جگہ سی بننا‬
‫اتنا مشہور لگتا ہے کہ یہ قابل اعتماد ہے‪ ,‬آسان اور استعمال میں آسان ہے۔ آج‬
‫اکثر سنا جاتا ہے – “ ‪ C‬پہلے ہی ‪ # C + + ، C‬اور جاوا جیسی زبانوں کے‬
‫ذریعہ سپر کیا گیا ہے‪.‬‬
‫انگریزی زبان سیکھنے اور سی زبان سیکھنے کے مابین ایک قریبی مشابہت‬
‫ہے‪ .‬انگریزی سیکھنے کا کالسیکی طریقہ یہ ہے کہ زبان میں استعمال ہونے‬
‫والے حروف کو پہلے سیکھیں ‪ ،‬پھر ان حروف تہجی کو الفاظ بنانے کے لئے‬
‫جوڑنا سیکھیں‪ ,‬جس کے نتیجے میں جملے تشکیل دینے کے لئے مل جاتے ہیں‬
‫اور پیراگراف تشکیل دینے کے لئے جملے مل جاتے ہیں‪.‬‬
‫لرننگ سی ایک جیسی اور آسان ہے‪ .‬پروگرام لکھنے کا طریقہ سیکھنے کے‬
‫بجائے ‪ ،‬ہمیں پہلے یہ جان لینا چاہئے کہ سی میں حروف تہجی ‪ ،‬نمبر اور‬
‫خصوصی عالمتیں کیا استعمال ہوتی ہیں ‪ ،‬پھر ان کو کس طرح مستقل ‪ ،‬متغیر‬
‫ اور آخر کار یہ کس طرح مشترکہ‬,‫اور مطلوبہ الفاظ استعمال کیے جاتے ہیں‬
.‫طور پر ہدایت تشکیل دیتے ہیں‬
.‫پروگرام بنانے کے لئے ہدایات کے ایک گروپ کو بعد میں جوڑا جائے گا‬

Lecture Note: 1

Introduction to C

C is a programming language developed at AT & T’s Bell Laboratories of USA in 1972.

It was designed and written by a man named Dennis Ritchie.

In the late seventies C began to replace the more familiar languages of that time like PL/I,
ALGOL, etc

ANSI C standard emerged in the early 1980s, this book was split into two titles:

The original was still called Programming in C, and the title that covered ANSI C was called
Programming in ANSI C.

This was done because it took several years for the compiler vendors to release their ANSI C
compilers and for them to become ubiquitous C seems so popular is because it is reliable, simple
and easy to use. often heard today is – “C has been already superceded by languages like C++,
C# and Java.

There is a close analogy between learning English language and learning C language. The
classical method of learning English is to first learn the alphabets used in the language, then
learn to combine these alphabets to form words, which in turn are combined to form sentences
and sentences are combined to form paragraphs.

Learning C is similar and easier. Instead of straight-away learning how to write programs, we
must first know what alphabets, numbers and special symbols are used in C, then how using
them constants, variables and keywords are constructed, and finally how are these combined to
form an instruction.

A group of instructions would be combined later on to form a program.

:‫بنیادی ساخت آف آف سی زبان‬


.‫ا ہے‬šš‫یروی کرت‬šš‫سی زبان میں لکھا گیا پروگرام اس بنیادی ڈھانچے کی پ‬
‫ اے‬.‫وں‬šš‫انچے میں ہ‬šš‫حصوں کا تسلسل ایسا ہی ہونا چاہئے جیسے وہ بنیادی ڈھ‬
‫ا‬šš‫رتیب ک‬šš‫اہئیں لیکن ؟ ت‬šš‫ونے چ‬šš‫ے ہ‬šš‫ادہ حص‬šš‫ا زی‬šš‫ک ی‬šš‫رام میں ای‬šš‫ی پروگ‬šš‫س‬
.‫حصے ہے ہونا چاہئے اس کے بعد‬

BASIC STRUCTURE OF C LANGUAGE:


The program written in C language follows this basic structure. The
sequence of sections should be as they are in the basic structure. A C program
should have one or more sections but the sequence of sections is to be followed.

1. Documentation section

2. Linking section

3. Definition section

4. Global declaration section

5. Main function section

Declar

ation

section

Execut

able

section

6. Sub program or function section

: ‫ دستاویز کا سیکشن‬.1

‫ئے‬šš‫رنے کے ل‬šš‫تاویز ک‬šš‫تعمال کی دس‬šš‫ات کے اس‬šš‫ا وجوہ‬šš‫پہلے آتا ہے اور منطق ی‬


.‫استعمال ہوتا ہے اپنے پروگرام میں‬
‫ ڈویلپر اور منطق کی تفصیالت لکھنے کے‬، ‫اس کا استعمال پروگرام کے مقصد‬
‫* اور‬/ ‫ا ہے‬šš‫ا جات‬šš‫ان میں کی‬šš‫ی زب‬šš‫تاویزات س‬šš‫ دس‬.‫کتا ہے‬šš‫ا جاس‬šš‫ئے کی‬šš‫ل‬
. /*

.‫جو بھی لکھا ہے اس کے درمیان یہ دو ہیں بالیا جاتا ہے تبصرے‬

1. DOCUMENTATION SECTION:

comes first and is used to document the use of logic or reasons in your program.

It can be used to write the program's objective, developer and logic details. The
documentation is done in C language with /* and */ .

Whatever is written between these two are called comments.

: ‫ لنکنگ سیکشن‬.2.
‫وڑنے کے‬šš‫و ج‬šš‫یہ سیکشن مرتب کرنے والے کو کلیدی الفاظ کے کچھ واقعات ک‬
‫ڈر‬šš‫ئے ؟ ہی‬šš‫رنے کے ل‬šš‫رام ک‬šš‫ا پروگ‬šš‫در آپ ک‬šš‫ال ان‬šš‫ا افع‬šš‫لئے کہتا ہے ی‬
.‫فائلیں اس حصے میں بیان کیا گیا ہے‬
> stdio.h < ‫شامل کریں‬# .‫جیسے‬

2. LINKING SECTION :
This section tells the compiler to link the certain occurrences of keywords or
functions in your program to the header files specified in this section.
e.g. #include <stdio.h>

: ‫ تعریف سیکشن‬.
‫یہ ہے استعمال کیا کرنے کے لئے اعالن کچھ مستقل اور تفویض وہ کچھ‬
.‫قدر‬
25 ‫وضاحت میکس‬# .‫جیسے‬

‫وضاحت ہے ایک مرتب کرنے واال ہدایت جو بتاتا‬# ‫یہاں یہاں‬


‫ہے ؟ مرتب کرنے واال جب بھی میکس ہے پایا گیا اندر ؟ پروگرام‬
.25 ‫اسے تبدیل کریں کے ساتھ‬

3. DEFINITION SECTION:

It is used to declare some constants and assign them some value.

e.g. #define MAX 25

Here #define is a compiler directive which tells the compiler whenever MAX
is found in the program replace it with 25.

You might also like