how to pass a set to function

This is a discussion on how to pass a set to function within the C++ Programming forums, part of the General Programming Boards category; i'm trying to pass a set<blabla*> to a function... i know it's done by reference but i can't find the ...

  1. #1
    Registered User
    Join Date
    Dec 2009
    Posts
    8

    how to pass a set to function

    i'm trying to pass a set<blabla*> to a function... i know it's done by reference but i can't find the right syntax...

    anyone can provide an example??

    thenx...

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    Just like anything else, you put the name of the set inside the parentheses of the function.

    In the parameter list, you put the object just as you would declare the object in the body of the code. If you want to pass by reference, put an & in front of the name.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help with 1 function
    By TetsuoShima in forum C Programming
    Replies: 7
    Last Post: 08-15-2010, 03:13 PM
  2. Seg Fault in Compare Function
    By tytelizgal in forum C Programming
    Replies: 1
    Last Post: 10-25-2008, 04:06 PM
  3. Speed test result
    By audinue in forum C Programming
    Replies: 4
    Last Post: 07-07-2008, 06:18 AM
  4. Bisection Method function value at root incorrect
    By mr_glass in forum C Programming
    Replies: 3
    Last Post: 11-10-2005, 09:10 AM
  5. Contest Results - May 27, 2002
    By ygfperson in forum A Brief History of Cprogramming.com
    Replies: 18
    Last Post: 06-18-2002, 02:27 PM

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