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...

do is a C++ keyword. That would probably hamper your ability to use it as an identifier.

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.

>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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.