So whats your lucky colour (C++ program to use array of pointers)

#include<iostream>
using namespace std;
int main(){
char*pstart[]={"red","blue","orange","pink","brown","black"};     //array of pointers
char*state={"your lucky colour is = "};
cout<<"enter your names first letter to know about your lucky star "<<endl;
char z;
cin>>z;
int b=(int)z;        //this is done to convert character in to  integer
srand(b);
cout<<state<<pstart[(rand()%6)]<<endl;

}


Previous
Next Post »

Comments:

Disqus Shortname