When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.
121 messages ยท Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.
do you have any other tests?
this test tests a lot of things working together and it would be good to narrow down what specifically is going wrong
If you don't then I would advise writing more tests that are smaller parts of the code e.g. this method currently tests that you're inserting and printing correctly but would be nice if it was one or the other
im new to cpp i didnt make the tests
the assignment came with a template of tests
i cant seem to figure out where im going wrong with these 2 functions
for the print i get this output: [7, 7, -3, 40, 500, -60, 7099] however im meant to get [1, 2, -3, 40, 500, -60, 7099], i am unsure where the 2 7;s are coming from?
do you have any ideas why this could be?
is the issue with my constructor?
okay well I think it helps to look at the failed output vs expected
expect = [1, 2, -3, 40, 500, -60, 7099]
actual = [7, 7, -3, 40, 500, -60, 7099]
seems like its just the first 2 elements that get messed up
have you tried stepping through it with a debugger?
sounds like it's time for self study ๐
debuggers are easy to learn, tbh
and probably the most powerful tool in a programmer's toolbox
I threw it into compiler explorer and it works fine
you sure you saved the file
and rebuilt the code
@thick lava link?
the same code works for you
?
passes the test?
yeah ive rebuilt the file
well id on't have the tests
using makefile
but I artificially recreated it
i can send the test file if you would like?
Memory Sanitizer doesn't like it
whats this?
does this mean my program has memory leaks?
It means you're using an uninitialized value
oh wtf
finding where it is real quick
ok thank you ๐
oh, it may be the standard library 
ive been stressed out abt this lmfao i have been tryna edit the print func for days ๐ญ
appreciate the help btw <33
oh lmfao
๐
yeah looks like gcc has a sanitizer issue in cout
this is the test file if you would like it the specific tests that fail are e and f
oh wait I meant clang lol
i use g++ in my makefile
if thats of any relevence
its given with the assignment
the makefile
looks like string stream has a sanitizer issue
is that because of me or just the import itself
so not your code, dw about it
its fine on gcc too 
madness
๐ญ
i feel like the mistake is in the constructor but i honestly have no clue
im j guessing
well as far as we can tell there is no mistake
you 100% sure you rebuilt it
yeah i ran make in terminal
try deleting the build and rebuilding from scratch
before i ran it
like deleteing the .o files
and restarign?
yeah delete any temporary build files
you can get bugs where you edited something like halfway through a build and it gets corrupted and messes with you
bro what the fuck
omds
it worked
holy shit
ur actually a life saver
like u dont understand
๐
honestly dw I had this the other day lol
brooo ive had this bug
since last night
i stayed up
cuz its due tmr
i was so stressed
๐ญ
only noticed because I tried to debug and the debugger wouldn't attach to the new code because it didn't exist
(for mine)
but yeah
its an annoying bug to run into
you're welcome
do u mind if i leave this tab open and paste questions if i hav more later
u guys seem rly knowledable
sure but you can just ask another question if it comes up
Lmao. I was going through this line by line trying to find the differences ๐ญ
glad it was something easy 
anyway yeah this is one of those things where you have to use the "there is a bug therefore something is wrong" principle
YOu check all the things within reason about your code and then you have to think "hmm if I assume the code is right for one second what else could cause this"
Not neccessarily something a beginner would be able to spot because you have to just know this can happen sometimes (and that usually comes from it having happened to you) but now you know
i see
yeah ill look out for this moving forwards
tysm!!
@sharp haven Has your question been resolved? If so, type !solved :)
!solved
Thank you and let us know if you have any more questions!
This thread is now set to auto-hide after an hour of inactivity