Wednesday, 2 July 2014

C++ program to print strings using array of pointers


Here is a C++ program to print strings using array of pointers


 SOURCE CODE OUTPUT
#include<iostream>
using namespace std;
int main()
{
    char *x[3]={"Monday","Tuesday","Wednesday"};
    for(int i=0;i<3;i++)
        cout<<"Address : "<<unsigned(x[i])<<"   String : "<<x[i]<<endl;
    return 0;
}

Any questions regarding to program please write in comments.

No comments:

Post a Comment