I am trying to finish my final debugging tonight. My problem is that I have been writing this code for a couple days and it has a few problems. Previous Post
It now compiles and does not crash, but there are a few issues with my functions not working properly (or at all).
#include <iostream>              
#include <string>
#include <fstream>
using namespace std; 
string bookTitle [50];
string bookAuthor [50];
int loadData (string pathname);         
int showall (int counter);
int authorSearch (string bookAuthor [50]);
int main ()
{  
    string pathname;
    int counter=0;
    char choice;
    cout<<"Input the name of the file to be accessed: ";
    cin>>pathname;
    loadData (pathname);
    showall (counter);
    cout<<"\n\n\n\n What would you like to do \n (A for Author Search , T for Title Search, Q to quit):";
    cin>>choice;
    while (choice != 'Q' , choice != 'q')
    {
          if (choice == 'A', choice == 'a')
          {
                    int authorSearch (string bookAuthor [50], char choice);
          }
          if (choice == 'T', choice == 't')
          {
                     int   titleSearch (string bookTitle [50], char choice);   
          }   
    }
    cout<<"Press <Enter> to Exit";
    cin.ignore();
    cin.get();      
    return 0;              
    cout<<"Press <Enter> to Exit";
    cin.ignore();
    cin.get();      
    return 0;                
}
int loadData (string pathname) // Loads data from infile into arrays
{
    fstream infile; 
    int counter = 0;
    infile.open(pathname.c_str()); //Opens file from user input in main
    if( infile.fail() )
     {
         cout << "File failed to open";
         return 0;
     }   
     while (!infile.eof())
     {
           infile >> bookTitle [counter] ;  //takes input and puts into parallel arrays
           infile >> bookAuthor [counter];
           counter++;
     }
     infile.close();
}
int showall (int counter)        // shows input in title(author) format
{
     cout<<bookTitle<<"("<<bookAuthor<<")";   
}
void authorSearch (string bookAuthor [50], char choice) // Function to search Author Array
{
     string target = "";
     cout<<"Which author would you like to search for: "<<target; //input
     for (int count = 0; count++;)
     {
         if(bookAuthor[count] == target) //tests input against array and outputs result
         {
                              cout<<bookTitle[count]<<bookAuthor[count];
         }
     }
}
void titleSearch (string bookTitle [50], char choice) // Function to Serch Title Array
{
     string target = "";
     cout<<"Which author would you like to search for: "<<target; //input
     for (int count = 0; count++;)
     {
         if(bookAuthor[count] == target) //tests input against array and outputs result
         {
                              cout<<bookTitle[count]<<bookAuthor[count];
         }
     }
}
Latest Version , no major improvements. I am having trouble getting the functions to work after the menu selection. ShowAll seems to work but outputs hex. Thanks again everyone!
#include <iostream>              
#include <string>
#include <fstream>
using namespace std; 
string bookTitle [50];
string bookAuthor [50];
int loadData (string pathname);         
int showall (int counter);
void authorSearch (string bookAuthor [50]);
void titleSearch (string bookTitle [50]);
int main ()
{  
    string pathname;
    int counter=0;
    char choice;
    cout<<"Input the name of the file to be accessed: ";
    cin>>pathname;
    loadData (pathname);
    showall (counter);
    cout<<"\n\n\n\n What would you like to do \n (A for Author Search , T for Title Search, Q to quit):";
    cin>>choice;
    while (choice != 'Q'|| choice != 'q')
    {
          if (choice == 'A'|| choice == 'a')
          {
                   void authorSearch (string bookAuthor [50], char choice);
          }
          if (choice == 'T'|| choice == 't')
          {
                    void titleSearch (string bookTitle [50], char choice);   
          }   
    }
    cout<<"Press <Enter> to Exit";
    cin.ignore();
    cin.get();      
    return 0;              
}
int loadData (string pathname) // Loads data from infile into arrays
{
    fstream infile; 
    int counter = 0;
    infile.open(pathname.c_str()); //Opens file from user input in main
    if( infile.fail() )
     {
         cout << "File failed to open";
         return 0;
     }   
     while (!infile.eof())
     {
           infile >> bookTitle [counter] ;  //takes input and puts into parallel arrays
           infile >> bookAuthor [counter];
           counter++;
     }
     infile.close();
}
int showall (int counter)        // shows input in title(author) format
{
     cout<<bookTitle<<"("<<bookAuthor<<")";   
}
void authorSearch (string bookAuthor [50], char choice) // Function to search Author Array
{
     string target = "";
     cout<<"Which author would you like to search for: "<<target; //input
     for (int count = 0; count++;)
     {
         if(bookAuthor[count] == target)
         {
                              cout<<bookTitle[count]<<bookAuthor[count];
         }
     }
}
void titleSearch (string bookTitle [50], char choice) // Function to Serch Title Array
{
     string target = "";
     cout<<"Which title would you like to search for: "<<target; //input
     for (int count = 0; count++;)
     {
         if(bookAuthor[count] == target) //tests input against array and outputs reults
         {
                              cout<<bookTitle[count]<<bookAuthor[count];
         }
     }
}
 
     
     
    