Getting frustrated

This is a discussion on Getting frustrated within the C++ Programming forums, part of the General Programming Boards category; This might present a problem with my overall grade, because one of my requirements is to have a function that ...

  1. #16
    Registered User
    Join Date
    Jun 2003
    Posts
    81
    This might present a problem with my overall grade, because one of my requirements is to have a function that receives the array of names, the array of social security #'s and the array of phone #'s and then sort them. All in one function.

  2. #17
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Originally posted by kippwinger
    This might present a problem with my overall grade, because one of my requirements is to have a function that receives the array of names, the array of social security #'s and the array of phone #'s and then sort them. All in one function.
    Ok:
    Code:
    void sortall( type array1[], type array2[], type array3[] )
    {
        ...do swapping stuff...
    
        swapstuff( array1, x, y );
        swapstuff( array2, x, y );
        swapstuff( array3, x, y );
    }
    I really don't see a problem, unless for some odd reason you can only have one function other than main.

    Quzah.
    Hope is the first step on the road to disappointment.

  3. #18
    Toaster Zach L.'s Avatar
    Join Date
    Aug 2001
    Posts
    2,686
    The sorting is done in one function. It calls another function simply for programmer convenience.

    If you made swap inline, however, you could definitely argue the point that its all in one function.
    The word rap as it applies to music is the result of a peculiar phonological rule which has stripped the word of its initial voiceless velar stop.

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. frustrated bout char array
    By royuco77 in forum C++ Programming
    Replies: 2
    Last Post: 07-11-2005, 10:10 AM
  2. A Bit Frustrated....
    By DirX in forum C++ Programming
    Replies: 3
    Last Post: 04-14-2003, 11:29 PM
  3. so confused and frustrated
    By ct26torr in forum C Programming
    Replies: 2
    Last Post: 02-13-2003, 10:40 PM
  4. frustrated job!
    By Cemilia in forum A Brief History of Cprogramming.com
    Replies: 14
    Last Post: 11-27-2002, 09:00 AM
  5. so frustrated!!!!
    By Unregistered in forum C Programming
    Replies: 3
    Last Post: 11-28-2001, 06:44 PM

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