943,793 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 371
  • C++ RSS
Sep 7th, 2009
0

inserting vectors in functions

Expand Post »
Hi,

I don't understand why I failed to insert vectors as an input of a function. I wrote :

void fun( std::vector<double> do, int &count ){
...
}

but it doesn't compile...
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
touqra is offline Offline
5 posts
since May 2008
Sep 7th, 2009
2

Re: inserting vectors in functions

do is a C++ keyword. That would probably hamper your ability to use it as an identifier.
Administrator
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Narue is offline Offline
11,807 posts
since Sep 2004
Sep 7th, 2009
0

Re: inserting vectors in functions

Click to Expand / Collapse  Quote originally posted by Narue ...
do is a C++ keyword. That would probably hamper your ability to use it as an identifier.
oops.. sorry, i was just making an example. My function was much more involved than this, so I made an example. I'm pretty sure I didn't use C++ keywords in my functions.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
touqra is offline Offline
5 posts
since May 2008
Sep 7th, 2009
2

Re: inserting vectors in functions

>My function was much more involved than this, so I made an example.
Posting code that isn't the same as the code that's giving you a problem is a sure way to receive unhelpful help. Post your real code, even if you have to cut out unrelated parts (without cutting out the error as well) to make it smaller.
Administrator
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Narue is offline Offline
11,807 posts
since Sep 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: pin code
Next Thread in C++ Forum Timeline: Manage Errors





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC