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 TouchToneTommy 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: lbucko
  • Content: Threads
  • Order by date
  1. lbucko

    Passing text from a file to an array??

    How do I read in text from a file into an array I have tried the following: while(fgets(phrase, 100, ffp)) but this doesn't seem to work, I want to read in from the a file with file pointer ffp, into array phrase. I also tried to do it the following way: int status = fscanf(ffp...
  2. lbucko

    Printing from an array of type struct

    Have two problems, first of all I want to print the values from an array of type struct Res, struct res { int doc_id; float score; }; typedef struct res Res; Res results[NUM_SITES][100];//Array I want to print from I've tried the following but can't seem to get it right...
  3. lbucko

    Arrays & selection_sort

    Is there a select_sort function for sorting arrays, I was told about but don't know how to use it. I want to sort an array according to a score assigned to each element void smart_2(FILE *file, char *query, Res results[][100]) { FILE *ffp; char phrase[100]; Res smrt_res[100];//array to...
  4. lbucko

    Storing a result in a 2D array

    How do I return a text string and a numerical value to an array? At the moment I'm just printing them out, code as follows, while(fgets(fname, 100, file) != NULL) { ffp=fopen(fname, " "); while(fgets(phrase, 100, ffp)) { if(strstr(phrase, query) != NULL) {...
  5. lbucko

    How to comape tokenised strings??

    I have a file which contains certain text strings. I also have a char array which contains a query string. I have tokenised both strings to take one word at at a time but am unsure as how to compare the tokens to find out if there is a match between them. What I am trying to achieve is to search...
  6. lbucko

    I have a function from which I need

    I have a function from which I need to return an array of values but I'm not sure how to go about this, do I need to use some sort of pointers? Some code shown below: while (index[i]<num_site) { max = get_biggest(index, results); res_arr[index_res++] = results[max][index[max]-1].score...
  7. lbucko

    Merging n sorted arrays

    I need to merge into a single array multiple sorted arrays. I can manage merging two arrays but don't know how to do it for n arrays. Any help would be appreciated. Section of current code shown below: while ((indexa<num_site1)&&(indexb<num_site2)) { if (site1[indexa]<= site2[indexb]) {...

Part and Inventory Search

Back
Top