I have to write a program that finds a pattern in a text using Brute-force method.
I have made functions to read the text file, pattern file and to execute the brute force algorithm(called match). These are called in main(). i need to store the index (at which the pattern is found in the text file)in an array and then print out that array in main.
How do I pass the array by reference??? Please help!!
the program gives an error that you cannot pass an array by reference.
Also, whenever I declare an array (in the function, match()) like this:
int arr[text_file_size]; (text_file_size is the size of the text file obtained by fseek() and ftell())
the program gives an error that you cannot initialize a constant array of size 0.
I printed out the text_file_size,it was not zero.
Edited 4 Years Ago by Remy the cook