|
-
May 5th, 2013, 11:00 PM
#3
Re: how to "Bold search result in C++"
thanks for the response.
i am using windows 7 64bit, and Turbo c compiler.
i have created a simple program in c++ graphic mode using library graphics.h, my program focused features are :
1) user will give values those will be store as an array, and when search button clicked on, a key will be ask to search and as search result i have showed the position(index) and count of the key value, but, 1 thing more to show is the part of my assignment that this key value should be appear in 'bold' format, if it exists in list/array.
2) i tried settextstyle() function for this purpose, but, it is not helpful. or may be i'm not using this function in proper way.
3) here given below is my code to perform search function, if you kindly guide me where and how i have to stick this function in this code;
cout<<"Enter a value to search : ";
gets(ch);
gotoxy(8,8);
cout<<" ";
gotoxy(5,9);
cn=valid(atoi(ch)); // check
if(cn==0)
{
gotoxy(8,8);
cout<<" ";
gotoxy(8,8);
cout<<"INVALID DATA......";
delay(700);
gotoxy(8,8);
cout<<" ";
gotoxy(8,8);
cout<<" ";
}
else
{
gotoxy(8,8);
cout<<" ";
gotoxy(8,8);
int number=atoi(ch);
searchno(number);
}
void searchno(int number)
{
int found=0, counter=0;
for(int i=0;i<posx;i++)
{
if(array[i]==number)
{
found=1; //indicator to check if found.
counter++;
//Bold(char text[i], int row, int col);
settextstyle(10,0,1);
cout<<number <<" found at Position ["<<i+1 <<"]" <<" and Total count of " <<number <<" is [" <<counter <<"] ";
}
}
if(found==0)
{
//gotoxy(30,3);
cout<<number <<" not found in the list.";
}
}
please guide me how to use this function or any solution else.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|