Grazie Professore non conoscevo l'inizializzazione degli array in questo modo. Video fantastico e fatto in modo semplice. Un saluto
@PortfolioCourses Жыл бұрын
You're welcome Massimo! :-)
@yogeshchauhan9401 Жыл бұрын
Very precise video 👍
@PortfolioCourses Жыл бұрын
I’m glad you enjoyed it Yogesh! :-)
@carmelostagno6352 Жыл бұрын
Thanks for your job. I learned very much from your videos and I hope you will continue in the future!
@PortfolioCourses Жыл бұрын
You're welcome Carmelo, I'm glad you're enjoying the videos! :-)
@FritsvanDoorn Жыл бұрын
One question. Although the optimizer might optimize it, ++i is faster than i++. So isn't it better to use ++i to indicate that you have thought about this? Thank you.
@PortfolioCourses Жыл бұрын
My understanding is that the whole topic of ++i and i++ and performance is complicated. :-) In addition to compiler optimizations, there is C vs C++, where in C++ the postfix and prefix increment operators can be overloaded for objects. There is also the issue of 'sequence points': en.wikipedia.org/wiki/Sequence_point. This answer here may be interesting, as well as the rest of the answers: stackoverflow.com/a/26482954. For this for loop though, using either i++ or ++i as the update statement will not have a difference in performance.
@FritsvanDoorn Жыл бұрын
@@PortfolioCourses I finally did some testing and indeed there is no difference in time. What I did was: an array of size 1000000, in a loop filled the array with its index *2, then in a new loop checked the values. Timed this for ++i and for i++ using clock_gettime() to measure nano seconds. Calculated an average over 100 times measuring. The values are actually nearly the same. Thank you for the extra information in your answer. Very interesting.
@CoderDBF Жыл бұрын
@@FritsvanDoornInteresting, thank you for testing this out. The only difference between science and goofing around is taking notes. You are a true scientist.