Anonymous
value of l seems fine
Raul
okay, so now do cout << l << " " << dec.size() << endl;
Raul
before the for loop
Anonymous
5 5 gets printed
Anonymous
and theres an input for which it works fine: 1 100 25 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 15
Elnee
I have given the question statement as well
Don't be a jerk. If nobody wants to answer you that's only your problem. No one owes nothing to nobody.
Raul
5 5 gets printed
this is odd, I wrote a small program similar to yours and it runs just fine. However, I still would do dec.size() instead of l, just incase something funny is going on.
Raul
Infact, do me a favor?
Raul
instead of doing cin >> dec[i]; do cin >> dec.at(i); and tell me what happens
Anonymous
ok, and to let you know i am using these flags with gcc: -std=c++14 -pthread -O3
Raul
yeah that's fine, just let me know what happens.
Anonymous
Its still the same :/
Raul
send the screen shot?
Anonymous
mystery
Anyone here who can help me to make a dictionary in c++ using file handling?
mystery
I am unable to print the meanibg of the word searched
Anonymous
although it doesnt make sense to me but i feel the error is in line 56 only(like you said)
Anonymous
possibly because i am using i-1 in cipher[i] = dec[i-1] / cipher[i-1];
Mandelbröt
We aren't here to do your assignments, you know?
I have never told that its my assignment.... Its a problem i have faced in competetive programming
Mandelbröt
lol it’s almost the same.
Who tolds u to solve it .... I am telling that whoever able to solve it .... And wants to help and share his/her knowledge ....
Dima
Who told that I am going to solve it lol, anyways gl
Errol
Hi guys, do we have a printf function that will print in a certain line but for your own check, especially for debugging purpose? I don't know if this will make sense...
Errol
Something like; printf("I'm about to prompt the user for a positive integer"); but which can only be seen by myself in a runtime...
Raul
this has got me pretty stumped. Your problem is most definitely in the for loop at line 30. Because that is where the core dumps. It seems to have an issue inserting at dec[4] for some reason.
Anonymous
its been few days with this, tried different possible outputs and printing various lines, but nothing works
Anonymous
only thing i have figured till now is that commenting lines 55-57, code runs fine
Anonymous
but why is it so i dont understand
Anonymous
and also in the line 49, i had written j++, this also gave floating line exception. Changing it to j-- it runs fine, other than line 56
Raul
I unfortunately do not have that answer for you.
Anonymous
man i dont actually know where to go now
Raul
maybe start from scratch
Anonymous
i can probably do that, but i might get something like this in the future again
Anonymous
So i wanted to know the reason
Raul
I honestly do not know. It don't know what would cause the code to break with those two line commented out.
Raul
It should just go to the next cout statement and print, but it jumps there for some reason.
Anonymous
thanks for your time! :)
Anonymous
i will try more trial and error
Anonymous
and if i suicide, pls tell the world the reason behind it Raul :P
Raul
Lol sounds good. Good luck.
Anonymous
👍🏻
Mandelbröt
Who told that I am going to solve it lol, anyways gl
Thanks a lot ... Keep smiling :) 😇
Anonymous
well thats quite right as i changed line 56 to cipher[i] = dec[i-1] / 2; and it works fine
Anonymous
but then why does it directly jumps to this line intead of printing lines 36 and 54 first?
Mihail
but then why does it directly jumps to this line intead of printing lines 36 and 54 first?
That's weird can you try adding an endl after them and see if they print? However I really don't think it should be necessary in the first place
Raul
Thanks a lot ... Keep smiling :) 😇
I figured out your problem
Raul
I'm not going to give you my code, but I know how to solve it.
Anonymous
heres how it looks
Mihail
Yeah this ^
Anonymous
ooh i see
Anonymous
thanks a lot @mmihov you saved my day 😃
Raul
TIL
Fox
Buffer overflowwwww
Fox
Any good sites for learning C ? :D
Anonymous
Best book for beginners for learning c programming completely ?
Valhaar Morghulis
Best book for beginners for learning c programming completely ?
Anonymous
__gcd() is an undocumented function of algorithm library, gcd() is in numeric library since c++17 https://stackoverflow.com/a/20664174/7866573
Nameful
Best book for beginners for learning c programming completely ?
I wouldn't recommend starting with a book
BinaryByter
I would though
Mat
Best book for beginners for learning c programming completely ?
You sent the same message of the guy before you. Wtf
Valhaar Morghulis
Coz I have the same query
Mat
Coz I have the same query
So wait for an answer. That's spamming
Anonymous
Ok
Raghav
/raghav
Anonymous
William
hi
Primidac of Africa
hi
How are you
William
fine and u
Maximus
"Approved by @roxifas" Callisto Network is hiring Smart-contract security auditors (EOS/ C++) to join our team. Job description on the URL below. https://github.com/EthereumCommonwealth/Proposals/issues/64 #Job #Auditors #EOS #C++
Mandelbröt
I'm not going to give you my code, but I know how to solve it.
Have u seen the problem statement... In pdf format ...
Mandelbröt
Whats the problem is
Raul
Yup
Anonymous
Okkkk
Anonymous
One big loot
Mihail
__gcd() is an undocumented function of algorithm library, gcd() is in numeric library since c++17 https://stackoverflow.com/a/20664174/7866573
Just using __gcd is undefined behavior. The __ functions are reserved for the implementation and there's zero guarantee it'll even be there or that it'll function how you'd expect it to. std::gcd is the thing you should be using
Jussi
Why boost if STL offers an implementation?