Ok, so I found the solution to my problem. I was doing everything correctly except that I'm using an old microsoft product. This was in an obscure MS KB article STL std::string class causes crashes...
Type: Posts; User: ryanrigdon
Ok, so I found the solution to my problem. I was doing everything correctly except that I'm using an old microsoft product. This was in an obscure MS KB article STL std::string class causes crashes...
Unfortunately simplifying my production code to do exactly what is shown in my last example func1 still has issues. I stripped everything else out of it and I'm still having deallocation issues. I...
I'm not sure where you mean for me to check the bounds unless it is in the "for" loop in func1. Unfortunately, checking the bounds isn't going to help because the error occurs in clear() which...
#include <vector>
#include <string>
using std::string;
using std::vector;
//func1 is in a separate dll
void func1(const vector<string> &vector1, vector<string> &vector2)
{
//it doesn't...
I'm similar to Daved in knowing nothing about MPI, but I have another possible suggestion. When you access an element of the vector you can call the c_str() function get raw text.
Like this:
...
Thanks for the quick response anon. To answer your questions:
I posted this as an example of the operations I am performing on the vectors without bogging you down on the details. All I am doing...
I have 2 vectors of strings. I'm passing them to a function by reference with one being const inside the function. I add some strings to the non-const vector and come out of the function. For some...
If you know the size of the buffer then you can use:
sizeof(char) * buffer_size
However the suggestion of using a smart container is much better.
Here's a website with many of the most common C++ data types.
So do you want the vector stored in a[1] to get pushed into the priority queue to or do you want the elements in the vector to get pushed? Your question is very vague and I think you might not...