8.3 USING POINTER WITH DIFFERENTYPES OF DATA

8.3 ডাটাৰ পৃথকপিচৰ সৈতে পইণ্টাৰ ব্যৱহাৰ কৰি

In all the example above, a pointer was used to point to an integer. It can also be used to point to other types of variables. In Example 8.7. we present a C program to access a character variable using a pointer. the syntax remains same.

ওপৰৰ সকলো উদাহৰণত, ইণ্টেগাৰ এটালৈ আঙুলিয়াবলৈ এটা পইণ্টাৰ ব্যৱহাৰ কৰা হৈছিল। ইয়াক আন প্ৰকাৰৰ চলকবোৰলৈ আঙুলিয়াই দিবলৈও ব্যৱহাৰ কৰিব পাৰি। উদাহৰণ স্বৰূপে 8.7। আমি পইণ্টাৰ এটা ব্যৱহাৰ কৰি এটা আখৰ চলক ব্যৱহাৰ কৰিবলৈ এটা চি প্ৰ’গ্ৰাম উপস্থাপন কৰোঁ। বাক্যবিন্যাস একে থাকে।

Example 8.7 A C program using a pointer for a char type variable.

Now let us see an interesting behaviour of pointers. Have a look at the C program presented in Example 8.8. We have used two pointers 8ch Ptr. The first pointer pointes to a char type variable and the second points to an int type variable.

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

Example 8.8 AC where pointers are used for different types of variables.