Linked Questions

8 votes
1 answer
4k views

Code of my program is #include <iostream> int main(int argc, const char *argv[]) { std::cout << "hello world!\n"; return 0; } I compiled it with flags -Wpedantic -pedantic-errors -...
Jacek Olchawa's user avatar
1 vote
2 answers
2k views

Here is simplified version of the code, I deleted everything that doesn't concern the problem. #include <iostream> #define N 3 int main() { int *input; int **cl; input = new int[...
smutnyjoe's user avatar
  • 343
0 votes
1 answer
437 views

I'm using an Ubuntu 14.04 image with VmWare, I'm writing a program in C++ & whenever I check the memory with Valgrind, I get a message that I have 1 alloc, with 0 free. The thing is, that I ...
Tango_Chaser's user avatar
0 votes
0 answers
47 views

I recently learned about the memory error checking tool, Valgrind. I checked for allocs on some very simple C++ code and found some interesting results which is very weird. For eg., #include<...
Kaushal Kishore's user avatar
0 votes
0 answers
35 views

I cannot understand what is happening in the following code: template<typename X> class TestClass { public: void alloc(X x) { } }; template<> void TestClass<int>::alloc(int ...
Victor Olaru's user avatar
9 votes
1 answer
10k views

Issue: I have a weird issue that I wasn't expecting. I have a class called Answers and within the header is this: class Answer { char* aText; bool b_correct; public: Answer():aText(0){;}...
user2470057's user avatar
3 votes
1 answer
3k views

I am new to CUDA and met a problem when writing a singleton/global variable using CUDA. The singleton allocates some cuda memory and tries to free it in the destructor. However, the destructor crashes ...
Bo Li's user avatar
  • 699
3 votes
1 answer
2k views

I have a very simple C++ program. #include <iostream> int main() { std::cout << "HI" << std::endl; return 0; } I compile this on a Mac with the command c++ --std=c++11 leak....
geoff's user avatar
  • 2,274
4 votes
0 answers
3k views

I am aware that there has been a lot of questions asked about this, but they are quite old and situation may be different now. I am running fairly new gcc (4.9.2), libstdc++ 3.4.21 and valgrind 3.10.1....
xba's user avatar
  • 187
0 votes
2 answers
864 views

I use doubly linked list to implement Deque in C++. Destructor: Deque::~Deque() { while (this->left_p) { node *temp = this->left_p; this->left_p = this->left_p-&...
齐天大圣's user avatar
  • 1,189
1 vote
1 answer
1k views

i have a code which i must fix it. It has a leak, I don't know where is the problem, but i think something is bad done. is there anybody who has the same problem and can help me please? ==3923== 32 ...
elhadi dp ıpɐɥןǝ's user avatar
1 vote
0 answers
2k views

I've looked around various bug notes and stackoverflow questions on this matter (link here) but I am still unable to understand whether: is it possible to write my c++ code in such a fashion that it ...
HazirBot's user avatar
  • 323
2 votes
1 answer
435 views

I have read multiple similar questions on the same topic that have been asked, but I was not able to resolve my issue by following them. I want to store pointers in a vector, but I see a memory leak. ...
Sayan's user avatar
  • 2,732
1 vote
1 answer
298 views

I made a C++ application and I currently test it for memory leaks. On g++ 7.2.0 it has no leaks but on g++ 5.4.0 it does. I have some classes (dynamic data structures) are initialized and used but ...
George Sp's user avatar
  • 572
0 votes
2 answers
472 views

I tend to do a leak-check with valgrind from time to time, just to ensure my code is leak-free. Usually, either it is leak free, or I get some trace to where the leak occurs (ie even if the leak ...
Sandro's user avatar
  • 151

15 30 50 per page