Quantcast
Channel: Pointers and memory allocation in C++ - Stack Overflow
Browsing latest articles
Browse All 3 View Live

Answer by hmjd for Pointers and memory allocation in C++

Pasting in outcome from comments.antal_termer was not initialised in the constructor, resulting in invalid memory access here:*(term+antal_termer) = *t;As the code is copying t, via assignment, you can...

View Article



Answer by Luchian Grigore for Pointers and memory allocation in C++

*(term+antal_termer) = *t;//This is were the program crashes antal_termer++;This crashes because you probably haven't allocated enough memory. Your best choice is to use a std::vector instead of a...

View Article

Pointers and memory allocation in C++

I recently started with C++ and i'm not entirely sure I grasp the concept of pointers and their connection to arrays. I have two classes, Term and Polynom. I have a main loop which allows the user to...

View Article
Browsing latest articles
Browse All 3 View Live




Latest Images