Subscribe Us

Responsive Advertisement

Advertisement

Array of pointers

 


Array of pointers



#include<bits/stdc++.h>

using namespace std;

int main()

{

    char *ptr[]={"ujjal","roy","ujjal"};

    char s[]="ujjal";

    for(int i=0;i<3;i++)

    {

        if(!strcmp(s,ptr[i]))

        {

            cout<<"found\n";

            return 0;

        }

    }

    cout<<"Not found\n";


    return 0;

}


Post a Comment

0 Comments