inserting vectors in functions

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: May 2008
Posts: 5
Reputation: touqra is an unknown quantity at this point 
Solved Threads: 0
touqra touqra is offline Offline
Newbie Poster

inserting vectors in functions

 
0
  #1
Sep 7th, 2009
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...
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,656
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 723
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Code Goddess

Re: inserting vectors in functions

 
2
  #2
Sep 7th, 2009
do is a C++ keyword. That would probably hamper your ability to use it as an identifier.
I'm here to prove you wrong.
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 5
Reputation: touqra is an unknown quantity at this point 
Solved Threads: 0
touqra touqra is offline Offline
Newbie Poster

Re: inserting vectors in functions

 
0
  #3
Sep 7th, 2009
Originally Posted by Narue View Post
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.
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,656
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 723
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Code Goddess

Re: inserting vectors in functions

 
2
  #4
Sep 7th, 2009
>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.
I'm here to prove you wrong.
Reply With Quote Quick reply to this message  
Reply

Message:



Similar Threads
Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC