C প্রোগ্রামিং করার সময় কি ভাবে Pointers কে ব্যবহার করবে

Submitted by administrator on Mon, 01/02/2012 - 16:10

Chapter 16 - Applying Pointers

In Chapter 11, "An Introduction to Pointers," you learned the basics of using pointers in C. Because pointers are very useful in programming, it's worth spending another hour to learn more about them. In this lesson, the following topics are discussed:

    Pointer arithmetic
    Passing arrays to functions
    Passing pointers to functions
    Pointing to functions

 

Summary
 

  •     You should always make sure that a pointer is pointing to a legal and valid memory location before you use it.
  •     The position of a pointer can be moved by adding or subtracting an integer.
  •     The scalar size of a pointer is determined by its data type, which is specified in the pointer declaration.
  •     For two pointers of the same type, you can subtract one pointer value from the other.
  •     The elements in an array can be accessed via a pointer that holds the start address of the array.
  •     You can pass an unsized array as a single argument to a function.
  •     Also, you can pass an array to a function through a pointer. The pointer should hold the start address of the array.
  •     You can either pass the unsized format of a multidimensional array or a pointer that contains the start address of the multidimensional array to a function.
  •     Arrays of pointers are useful in many cases that deal with character strings.
  •     You can call a function via a pointer that holds the address of the function.


 

 

Related Items

Another Function for Writing: putchar()

Another Function for Writing: putchar()

C প্রোগ্রামিং এর putc() Function এর ব্যবহার

Using the putc() Function
The putc() function writes a character to the specified file stream, which, in our case, is the standard output pointing to your screen.

 

C প্রোগ্রামিংয়ের getchar() Function এর ব্যবহার

Using the getchar() Function
The C language provides another function, getchar(), to perform a similar operation to getc(). More precisely, the getchar() function is equivalent to getc(stdin).

 

The syntax for the getchar() function is

 

C প্রোগ্রামিংয়ে getc() Function এর ব্যবহার

Using the getc() Function
The getc() function reads the next character from a file stream, and returns the character as an integer.

 

The syntax for the getc() function is

 

C প্রোগ্রামিং এর double Data Type সম্পর্কে আলোচনা

The double Data Type
In the C language, a floating-point number can also be represented by another data type, called the double data type. In other words, you can specify a variable by the double keyword, and assign the variable a floating-point number.