Whats wrong here?

This is a discussion on Whats wrong here? within the C++ Programming forums, part of the General Programming Boards category; Code: //Begin Search Function void Search(/*char input[25]*/) { cout << "Please Enter The Surname You are searching for" << endl; ...

  1. #1
    Registered User
    Join Date
    Apr 2006
    Posts
    4

    Whats wrong here?

    Code:
     //Begin Search Function
    void Search(/*char input[25]*/)
    {
    
    cout << "Please Enter The Surname You are searching for" << endl;
    cin.getline(input,NAME_LEN);
    
    
    int r;
    int t;
    int z = 0;
    
    do
    {
    z++;
    }while (input[z] != '\0');
    
    for(r=0; r<=n; r++)
    {
    for(t=0; t<z; t++)
    {
    if (ref[r].name[t] == input[t])
    {
    if (t == z-1)
    {
    displayOrder(ref[r]);
    system("pause");
    } 
    } 
    }
    //displayOrder(ref[r]);
    //system("pause");
    } 
    
    }
    //End Search Function
    
    //Begin Main
    int main(int argc, char *argv[])
    {
    InFile(ref[1]);
    n = 1;
    do
    {
    if ((ref[n].initials[0] >= 'A' & ref[n].initials[0] <= 'Z') ||
    (ref[n].initials[0] >= 'a' & ref[n].initials[0] <= 'z') )
    n++;
    //cout << n << endl;
    }while ((ref[n].initials[0] >= 'A' & ref[n].initials[0] <= 'Z') ||
    (ref[n].initials[0] >= 'a' & ref[n].initials[0] <= 'z') );
    (ref[n].initials[0] >= 'a' & ref[n].initials[0] <= 'z') );
    //system("pause");
    Search();
    GetOrder();
    cout << "Do you wish to see your orders?" << endl;
    new_order = YesNoQuestion();
    if (new_order == true)
    {
    system("cls");
    for (n=1; n<=m; n++)
    displayOrder(ref[n]);
    }
    
    
    OutFile(ref[1]);
    
    
    system("PAUSE");
    return 0;
    }
    //End Main

    In the line I've highlighted red it comes up with an error saying 'statement missing'. I'm new to this so what do you suggest? I'm probably being really thick because its something simple, but I've working on this for eight hours and my minds boggled. I would really appeciate the help
    thanks

  2. #2
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    It doesn't belong to the while-loop due to the ; on the previous line
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  3. #3
    Registered User
    Join Date
    Apr 2006
    Posts
    4
    oh right, thanks got it now

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 9
    Last Post: 07-15-2004, 03:30 PM
  2. Debugging-Looking in the wrong places
    By JaWiB in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 11-03-2003, 09:50 PM
  3. Confused: What is wrong with void??
    By Machewy in forum C++ Programming
    Replies: 19
    Last Post: 04-15-2003, 12:40 PM
  4. God
    By datainjector in forum A Brief History of Cprogramming.com
    Replies: 746
    Last Post: 12-22-2002, 11:01 AM
  5. Whats wrong?
    By Unregistered in forum C Programming
    Replies: 6
    Last Post: 07-14-2002, 01:04 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21