std
Why do I get a segmentation fault while iterating through this vector?
I need to go through this vector and delete the duplicates. A segmentation fault is occurring somewhere within this code. My guess is that it has something to do with deleting elements while the itera[详细]
2023-04-10 04:52 分类:问答Can you change a std::list while iterating through it?
In the following functions, it it entirely possible for the IObserver\'s Process() function to try to remove itself from the notify list, using the this pointer\'s DeleteObserver().[详细]
2023-04-10 00:14 分类:问答C++ std::list of pointer to a struct
I believe it\'s a very easy question but I\'m quite confused. What I am d开发者_运维问答oing wrong ?:[详细]
2023-04-09 18:44 分类:问答How does std::endl not use any brackets if it is a function?
The question is pretty much in the title. According to C++ Reference,开发者_Go百科 std::endl is actually a function. Looking at its declaration in <iostream>, this can be verified.[详细]
2023-04-09 17:01 分类:问答C++ std::string and string
I don\'t suppose anyone tell me whats the difference between using the std::string and just the string data type in C++??[详细]
2023-04-09 16:48 分类:问答Why does std::fopen and std::filebuf::open trim trailing space characters on Windows?
I stumbled on a strange problem when trying to port a piece of C++ code from MSWindows to linux (Mint10). I discovered that there was a little typo in a hard-coded filename : a trailing space char (\\[详细]
2023-04-09 04:45 分类:问答How to free c++ memory vector<int> * arr?
I have a vector<int>* arr, which is actually a 2D array. arr =new vector<int> [size]; Is it ok that I just do[详细]
2023-04-08 23:50 分类:问答How did malloc and calloc end up with different signatures? [duplicate]
This question already has answers here: Closed 11 years ago. Possible Duplicate: Why calloc takes two arguments while malloc only one?[详细]
2023-04-08 18:44 分类:问答Very Basic std::vector iterating
std::vector<Ogre::SceneNode*>::iterator itr; for(itr=mSelectedObjects.beg开发者_如何学Cin();itr!=mSelectedObjects.end();itr++){[详细]
2023-04-08 12:26 分类:问答Will clearing an already empty vector lead to undefined behavior?
What happens if I clear a vector which was already cleared before? I tried it out in Visual Studio and it did not lead to any run-time errors. But I\'m hunting for a possible cause to an exception (b[详细]
2023-04-08 03:30 分类:问答