   friendd function access
  I have been programming for awhile now and I have a very simple question about friend functions. So I know that friend functions have access to private data members for whatever class its associated with. My question is do friends not have access to private functions? Reason being I'm writing a program to evaluate bridgehands and I have run into a problem with one of my friend functions. Here is the code// 13 cards are in a bridge handconst int MAX_CARDS = 13;int digit_to_int(char c);class BridgeHand{public:friend istream& operator >>(istream& ins, BridgeHand& b);friend ostream& operator <<(ostream& outs, const BridgeHand& b);private:struct Card{char rank; // value of cardchar suit; // suite of cadCard& operator =(const Card& right_side){rank = right_side.rank;suit = right_side.suit;return *this;}};void sort(Card cards[], int max);int index_of_largest(const Card cards[], int start_index, int max);void swap(Card& c1, Card& c2);Card cards[13];};So my problem is that when the friend ostream tries to access sort the compiler tells me that sort identifier not found and I am assuming its because a friend function doesn't have access/can't see private functions but I am a little confused as to why. Any help would be great.   
  Why not just try making sort public and seeing if the code compiles... That will answer the question :)   ;  Well I did switch the function to void output() instead of the current function and it worked just fine so I am sure that it's because the ostream function is a friend. I am now just wondering is it possible to access private functions from a friend function?   ;I did a little research and found the following tidbit: "A friend function is a function that can access the private members of a class as though it were a member of that class."   