8.1 INTRODUCTION

8.1 পৰিচয়

Recall our discussion from Class IX that when we declare a variable in a C program, some space is allocated for that variable in Computer memory. The space has a specific location and it is identified by its address.

নৱম শ্ৰেণীৰ পৰা আমাৰ আলোচনামনত পেলাওক যে যেতিয়া আমি চি প্ৰ’গ্ৰাম এটাত চলক ঘোষণা কৰোঁ, কম্পিউটাৰ মেম’ৰীত সেই চলকৰ বাবে কিছু স্থান আৱণ্টন কৰা হয়। স্থানটোৰ এটা নিৰ্দিষ্ট অৱস্থান আছে আৰু ইয়াক ইয়াৰ ঠিকনাৰ দ্বাৰা চিনাক্ত কৰা হৈছে।

We may use %p specifier and ampersand operator (&) to display the address of a variable declared in C. Example 8.] shows a simple program to demonstrate the same. The program will output a hexadecimal number that indicates the memory location where the variable X is stored.

আমি %পি স্পেচিফায়াৰ আৰু এম্পাৰচেণ্ড অপাৰেটৰ (&) ব্যৱহাৰ কৰি চি.-ত ঘোষণা কৰা চলকএটাৰ ঠিকনা প্ৰদৰ্শন কৰিব পাৰোঁ। উদাহৰণ 8.] একেটা প্ৰদৰ্শন কৰিবলৈ এটা সৰল প্ৰ’গ্ৰাম প্ৰদৰ্শন কৰে। প্ৰ’গ্ৰামটোৱে এটা হেক্সাডেচিমাল নম্বৰ আউটপুট কৰিব যি মেমৰিঅৱস্থান সূচায় য’ত চলক এক্স সঞ্চিত থাকে।

Example 8,1 A simple C program to display the address of a uariable.

If want to see the size of the address of X, we may use the sizeof() operator of C. Example 8.2 shows this. The sizeof() operator returns the size in number of bytes.

যদি এক্স-ৰ ঠিকনাৰ আকাৰ চাব বিচাৰে, আমি চি-ৰ আকাৰ () অপাৰেটৰ ব্যৱহাৰ কৰিব পাৰোঁ। উদাহৰণ 8.2-এ ইয়াক দেখুৱায়। অপাৰেটৰৰ আকাৰে বাইটৰ সংখ্যাত আকাৰ ঘূৰাই দিয়ে।

Example 8.2 A simple to display the address of a variable and its size.

Now, if we want to store this address of another variable, we can do so with the help of a pointer.

এতিয়া, যদি আমি আন এটা চলকৰ এই ঠিকনাটো সংৰক্ষণ কৰিব বিচাৰো, আমি পইণ্টাৰ এটাৰ সহায়ত এনে কৰিব পাৰোঁ।

A pointer is a special variable that stores the address of another variable. pointers have many usages in C programing. In this chapter , we will learn some of them.

পইণ্টাৰ হৈছে এক বিশেষ চলক যি আন এটা চলকৰ ঠিকনা সংৰক্ষণ কৰে। চি প্ৰগ্ৰামিংত পইণ্টাৰবোৰৰ বহুতো ব্যৱহাৰ আছে। এই অধ্যায়ত, আমি সেইবোৰৰ কিছুমান শিকিম।