3 Replies - 336 Views - Last Post: 02 November 2012 - 08:28 PM Rate Topic: -----

#1 xZachtmx  Icon User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 125
  • Joined: 14-June 09

Can I pass a vector of pointers by reference?

Posted 02 November 2012 - 06:14 PM

Hi guys. I am trying to pass a vector of pointers by reference in a function like:
void getBoundsOfStrokes(vector<Stroke*> & strokes, vector<int> & values)


But I get the following error:

in passing argument 1 of ‘void getBoundsOfStrokes(std::vector<Stroke*>&, std::vector<int>&)’


Is this not possible? Thanks for any advice.

Is This A Good Question/Topic? 0
  • +

Replies To: Can I pass a vector of pointers by reference?

#2 jjl  Icon User is offline

  • Engineer
  • member icon

Reputation: 1072
  • View blog
  • Posts: 4,532
  • Joined: 09-June 09

Re: Can I pass a vector of pointers by reference?

Posted 02 November 2012 - 06:17 PM

can you post the rest of the code (or at least where you pass the vectors)

And the answer is yes, it is possible

This post has been edited by jjl: 02 November 2012 - 06:18 PM

Was This Post Helpful? 0
  • +
  • -

#3 xZachtmx  Icon User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 125
  • Joined: 14-June 09

Re: Can I pass a vector of pointers by reference?

Posted 02 November 2012 - 08:24 PM

View Postjjl, on 02 November 2012 - 07:17 PM, said:

can you post the rest of the code (or at least where you pass the vectors)

And the answer is yes, it is possible


Well the thing is, I get the error on that line, I havent even passed anything yet, the error occurs on the function definition. In eclipse that line is what is underlined in red. There isnt any code yet that uses this function. Thanks for your reply by the way.
Was This Post Helpful? 0
  • +
  • -

#4 jjl  Icon User is offline

  • Engineer
  • member icon

Reputation: 1072
  • View blog
  • Posts: 4,532
  • Joined: 09-June 09

Re: Can I pass a vector of pointers by reference?

Posted 02 November 2012 - 08:28 PM

Can you post the entire error message then?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1