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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: sharathr
  • Order by date
  1. sharathr

    bsearch is returning different value.

    Thanks Salem.
  2. sharathr

    bsearch is returning different value.

    Example: array is as below struct grp_cdng new_grp[] = { {6,0}, {6,3}, {8,1}, {8,3}, {13,2} }; key is set to 8 so search_me is returning (8,1), I don't know which position this element is there(3rd) in the array? I should not go each element in the array(0 to 5) to compare...
  3. sharathr

    bsearch is returning different value.

    I didn't understad how to get the position of the key in the array after it is returning pointer from bsearch. I didn't want go each eliment in the array to compare the values returned from bsearch pointer. Sharath.
  4. sharathr

    bsearch is returning different value.

    Can you please give me some examples in my case how to do linear search. Regards, sharath.
  5. sharathr

    bsearch is returning different value.

    Thanks Salem, I have a situation where my array is having following values struct grp_cdng new_grp[] = { {6,0}, {6,3}, {8,1}, {9,3}, {13,2} }; when my key is 6, I would like to know following things: 1. The program should return 2(count) when I'm searching array with key value...
  6. sharathr

    bsearch is returning different value.

    Hi All, Please find the program where I'm passing key value '6' for searching in array of structures but it is returning 'The number is in the array cdng::8 grp_idx::1' as output. Can somebody please let me know what I'm doing wrong? ------------------------------------ #include <stdio.h>...

Part and Inventory Search

Back
Top