Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search program with C++

Status
Not open for further replies.

vivchiu

MIS
May 24, 2002
3
HK
I'm using Borland C++ builder.

How can I design a search program with darry ?

The text file like follow:

This is massage 1.
This is massage 2.

Output as:

This=2
is=2
massage=2
1=1
2=1
.=2


Please help
Thanks
 
I'm afraid thats what the programming is all about, Do-It-Yourself. Here it's mostly hints and single problems which are answered, not entire programs being created.
 
Thanks your reply, Wings.
darry is my type mistake, the correct is 2 D arry.

Thank you.
 
Just create two loops within one another to search

for example:

lets assume you want to add the contents of an array to a
memo box.
Memo1->Clear();

String Names[5][2];

int MajorIndex = 0;
int MinorIndex = 0;

while (MajorIndex != 5)
{
while (MinorIndex != 2)
{
Memo1->Lines->Add(Names[MajorIndex][MinorIndex]);
MinorIndex++;
}
MinorIndex = 0;
MajorIndex ++;

}

use a variation on this to get what you want
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top