Yes, it is. Thank you. I just didn't find it when i looked for it next day.
By the way this site (thescripts) is excellent, effective and useful. It is a pleasure to be here.
purso01...
User Profile
Collapse
-
The policy with answered questions
What is the policy with answered questions?
Some day ago, i send a question on stl. I got the answer very soon and corrected my program, and, then, i send a reply back consisting of a few lines of code that explicated my error.
However, from then on, my original question, the answer and my comments and thanks seem to be disappeared.
Are all answered questions deleted?
purso01 -
Thank you, horace1.
Now, i understand what was the mistake. I assumed that push_back only adds items to a vector when it is needed. I thought that as i had only two members added into the vector, the third should go to the remaining empty slot. That was wrong.
The revised program runs fine.
...Code:#include <iostream> #include <fstream> #include <vector> #include <algorithm>
Leave a comment:
-
segmentation fault in stl vector.put_back
I get a segmentation fault error when I compile the following program.
The v2 vector contains ponters to float values in the array v.
...Code:#include <iostream> #include <fstream> #include <vector> #include <algorithm> using namespace std; int main (int argc, char *argv[]) { float a = 3, b = 2, c = 1; float v[3]; v[0] = a; v[1] = b; v[2] = c;
No activity results to display
Show More
Leave a comment: