>>816913
Nah. Don't quit yet. Identify whether the problem is that you lack a sufficient conceptual understanding of the problem at hand, or that you understand the problem, but you're having difficulty creating a solution with the tool at hand (in this case, C++ and the features it provides).
If the former, you're going to have to work harder to ensure that you have a solid understanding of the problem you're trying to solve before you attempt to tackle it in code. What is it, exactly, that you're trying to do? You may even need to get paper and pencil and work it out visually, by sketching or otherwise. I was once trying to work out a problem that had to do with a cube, so I actually made a physical cube out of paper to help me visualize.
If the latter, you're going to have to work to understand how to translate your understanding of the problem into something amenable to solution with the tool at hand (C++). Try to identify what's going wrong. Have you made incorrect assumptions about the way a C++ feature is working? Break the problem down into smaller parts (if possible) and try to solve them individually.
If you have both problems, well, then you have even more hard work in front of you. But it's not impossible. Try to get enough rest, but spend as much time as reasonably possible working toward a breakthrough.
One final piece of advice, though it's not always applicable. C++ is a high-level language, but many people don't find it as easy as, say, Python or Ruby. Sometimes, it can be beneficial to prototype something in Python before tackling it in C++ (or C, or another compiled language). I was once trying to implement an algorithm I read about in a CS journal in Java, and I thought I had it, but something was totally fucked up. The program compiled and ran, but the results I was getting when I ran the algorithm on a known dataset were totally wrong, and I couldn't tell whether the problem was with my understanding of the algorithm, or my understanding of Java (which I didn't know well). So I tried it in Python (which I was much more familiar with), and quite quickly had the algorithm implemented and got the correct results. It was helpful, because it told me that I understood how the algorithm worked, but something about my understanding of Java was fucked up, and I needed to go back and test and figure out where my understanding of what I was doing in Java had gone wrong. This was ~10 years ago, and I forget what it was, but I did eventually figure it out. I probably saved more time with my Python detour than I would have just staring at the Java code with no idea of how/where I fucked up.
Work hard, and in the end, you'll probably get it. If you enjoy the hard work (or, at least, if the result it worth it), you're good. If you hate it, consider whether you hate it more than you would doing something else with your life. If not, stick with it. Most people hate their jobs.
Good luck.