correctmaninwrongplace
don't understand those things yet
Anonymous
I'll try doing this exercise, I have nothing else to do so 😆
Anonymous
lololol
Anonymous
I think I'm done
Anonymous
I didn;t extensively test it yet
Anonymous
btw, if you wonder what the solution is
Anonymous
https://pastebin.com/DHTNXSn7
Anonymous
Here's the disassembly of it
Anonymous
*runs away*
correctmaninwrongplace
in c+++ you can get it in 12/13 lines
Anonymous
Well, I can't give the C++ solution, since that would be doing his homework
correctmaninwrongplace
i remember that the 1º exam that i did in university had this same exercise, but it was C
Anonymous
Well, it's the same really :D
correctmaninwrongplace
i didnt pass that day, luckyly i got it in the 2º try
Anonymous
The differences don't come into play at this level
correctmaninwrongplace
scanf/cin only difference
Anonymous
yeah
Anonymous
Hello all. I am planning to learn Machine learning. But I don't know anything about programming. So my doubt is whether I should learn C/C++ first or directly learn Python. Please suggest someone. I am tensed
Anonymous
hm, I'd say go to Python directly personally...C++/C has its own quircks etc.
NinuX
C/++ isn't the answer for that
Anonymous
or Lua....joke
NinuX
or Lua....joke
😂😂😂😂😂😂
correctmaninwrongplace
and if you want to learn C++ you can try the book of the creator of c++ http://www.stroustrup.com/4th.html
Anonymous
I'm doing that right now
Anonymous
...It's not an easy read, but not a hard one either
Anonymous
(Probably because I'm reading the reference manual 😆)
Anonymous
The C++ Programming Language
NinuX
Kek
Anonymous
by Bjarne Stroustrup
NinuX
C++ maybe looks easy
NinuX
But it's not
Anonymous
ikr
NinuX
Anonymous
I have a question...
Anonymous
Does G++ optimize tail recursion?
correctmaninwrongplace
https://www.youtube.com/watch?v=bSkpMdDe4g4
correctmaninwrongplace
Interesting video
correctmaninwrongplace
Does G++ optimize tail recursion?
https://stackoverflow.com/questions/34125/which-if-any-c-compilers-do-tail-recursion-optimization
correctmaninwrongplace
But be carefull with optimizations from compilers, you could get security problems, the video that i have send here give some example about it
Anonymous
hm, I'd say go to Python directly personally...C++/C has its own quircks etc.
But won't the lack of basic C/C++ limit my application in Python??
correctmaninwrongplace
Most of programming things that you will learn are independent from language
correctmaninwrongplace
And the main difference that you will find between C/C++ and other languages are the use of pointers, that most of the time you wont use it, unless you want something specific
Anonymous
well, in C you use them quite often, C++ hides them more using references
Anonymous
The best thing though is a pointer to a pointer
Anonymous
Or a pointer to a pointer to a pointer
correctmaninwrongplace
The best thing though is a pointer to a pointer
Dont remind me, 1º time i saw it, i was like "what did the guys that made this smoke before make this shit"
Anonymous
Well, I can sort of grasp by just telling myself it's an array of pointers :D
Anonymous
Then it makes sense
correctmaninwrongplace
Well, I can sort of grasp by just telling myself it's an array of pointers :D
now yes, i understand it, but at the beggining was like that
correctmaninwrongplace
it took more time that i would have like to be able to work with them properly
Anonymous
brb
๐‘ ๐‘Ž๐‘›๐‘–
No solutions? ????
correctmaninwrongplace
correctmaninwrongplace
Its short, try it
correctmaninwrongplace
if you have fails in you code, we can solve it
correctmaninwrongplace
But we wont give you the solution if you dont even try 1st
๐‘ ๐‘Ž๐‘›๐‘–
What about other numbers
Anonymous
...
Anonymous
There's a million ways to do this
Anonymous
As there is always in programming
Anonymous
But the solution I came up and he came up were almost exactly the same
Anonymous
about 13 lines of code
Anonymous
I like how you show only the main function declaration lol
Anonymous
:)
Anonymous
you need to know: 1. 1 type of loop from C++ 2. operator % 3. operator /
Anonymous
Do you know these things/know where to look them up?
correctmaninwrongplace
correctmaninwrongplace
Anonymous
What editor are you usimg?
Anonymous
Sublime?
correctmaninwrongplace
ATOM
correctmaninwrongplace
I prefer ATOM because is libre
correctmaninwrongplace
But i cant say Sublime is bad, i used it before ATOM
Anonymous
I mostly use an IDE on windows like Dev-Cpp, but on Linux I use vim or sublime (sometimes gedit)
correctmaninwrongplace
i havent use VIm or emacs yet