Pointer in Array

#include <iostream>
using namespace std;
int main()
{
    char *array[4]={"Rimon", "Nihar", "Tonoy"};
    for(int i=0;i<=sizeof(array);i++)
    {
            cout<<array[i]<<endl;
    }
    system("pause");
    return 0;
}


The output is given below:
Rimon
Nihar
Tonoy

1 comments:

zzzzz said...

Array of pointers in C can be declared like an array of integers or character. An array of pointers in Cis a collection of pointer variables stored in continuous memory location. In other works, it is an array of addresses.

Post a Comment