The point of not plagarizing is that you'd learn to solve some of this by yourself :) Some of the stuff gpt generates doesn't work and there's more basic atomics you can use (such as passing vector instead of using a smart pointer).
This is just pain to watch. Why do you keep a ton of classes in one file? Why don’t you just look up the „incomplete Type error“ and find out, that you forward declare and use the class at the same Time.
You dont need to have a vector inside a smart pointer, since vector is a heap allocated container it already is (technically) a pointer also dont use auto when passing arguments to functions.
Note that the functions lifetime ends with returning thus killing the Type foo. The vector will not have access after it, but in this case the vector is dead as well.
@TheRealZitroX Ok yes, this is what I meant, I just worded it poorly, the chunk of memory the vector holds is on the heap, unless you use a stack allocated allocator 😆
Every programmer nightmare I'm working in c and Python and I love it when someone types in C++.It's hilarious😂 ps.Keep coding my man
You’ve seen what?
This is just pain. Like python codes that run fucking slow cause noone learns about performance and code structure
Also, I'm learning C++ this summer because I have no summer vacation plans. Let's keep coding and get good at it💪
Take it all the way to binary 🤌
define the Student class (the implantation) or any class that is giving you this problem BEFORE using it in
You pray to help.
The point of not plagarizing is that you'd learn to solve some of this by yourself :) Some of the stuff gpt generates doesn't work and there's more basic atomics you can use (such as passing vector instead of using a smart pointer).
Btw, you dont have to compile the code all the time. The problems tab shows the errors from the lsp. It will update when you change the code :)
Yo I can help you debug if you share the code. I'm pretty good at C++.
This is just one classfile.
What should be done here?
u are not learning (good) c++ fron chatgpt im sorry to tell you😭
My eyes started burning from looking at this
This is just pain to watch.
Why do you keep a ton of classes in one file?
Why don’t you just look up the „incomplete Type error“ and find out, that you forward declare and use the class at the same Time.
You dont need to have a vector inside a smart pointer, since vector is a heap allocated container it already is (technically) a pointer also dont use auto when passing arguments to functions.
You missed the point of shared pointer.
And no. A vector with „std::vector v;“ will be on the stack and elements get allocated on the heap.
„ int main() {
vector bar;
Type foo;
bar.push_back(&foo);
}“
In this case it is mixed. Heap points to stack variables.
Note that the functions lifetime ends with returning thus killing the Type foo. The vector will not have access after it, but in this case the vector is dead as well.
@TheRealZitroX Ok yes, this is what I meant, I just worded it poorly, the chunk of memory the vector holds is on the heap, unless you use a stack allocated allocator 😆
dont!!! chatgpt doesnt always teach it the right way!!! use youtube for better practices please!!!
I’ve seen a lot of shit posts that teach crap p
You should not learn from AI lmao, your learning bad stuff.