// Find.cpp : Defines the entry point for the console application. // // #include "stdafx.h" #include class CFind { private: int num[5]; char* str[5]; public: CFind(); ~CFind(); void FindView(int number); void FindView(char* charStr); }; CFind find; CFind::CFind() { find.num[0]=100; find.num[1]=200; find.num[2]=300; find.num[3]=400; find.num[4]=500; find.str[0]="book"; find.str[1]="press"; find.str[2]="student"; find.str[3]="uni"; find.str[4]="computer"; } CFind::~CFind() { } void CFind::FindView(int number) { for(int i=0; i<5; i++) if(find.num[i]==number) { cout << "Found number."; cout << find.num[i]; cout << "\n"; break; } } void CFind::FindView(char* charStr) { for(int i=0; i<5; i++) if(find.str[i]==charStr) { cout << "Found string."; cout << find.str[i]; cout << "\n"; break; } } void main(void) { find.FindView(300); find.FindView("computer"); }