masks to check only part of an IPv4 address
it checks to see if the ipv4 address is loopback
I advise you to use a book for networking. A good book I guess covers this stuff. You won't need to read it if you don't want to, but it can be used to check things like this. Sometimes things might get too confusing when you're still learning.
or atleast use search engines properly
When you are still at the basics sometimes you don't even know what to search. For some people it's easier for others harder
when you have little pieces of puzzle so it's not that hard to find other pieces with simple searchs. he is already in production so he will not spend time to read big books but i'm not suggesting to avoid books anyways
they could hide lil confusions behind macros, you do it from now on
and keeping all documentations in mind solves no problem just wastes time and opportunities.
What about hiding them behind inline functions like decent human being 😑
Is there inline in C?
inline function is not guaranteed to be inline or avoid ruining your stack etc.
btw when I tried to define some macros in c++ after some search on how bad of a practice it is (I already knew that one shouldn't prefer macros to functions, but I couldn't find alternatives) I immediately cancelled all the macros I had defined and started searching new ways 😂
Inline means the linker does whatever it wants with it, but the main point is having readable code that you can debug without having to compile it after a manual preprocessor pass
What I dislike most is that macros don't have a scope (do they?)
nope C/C++ macros dont
You can use the do{}while trick for that but meh
templates, inheritance, etc makes same problems for debugging. you guarantee inlining i will use it
I don't try to be smarter than a piece of software literally able to count the cycles both options will take on the actual hardware I will run on
I usually read that some compilers may inline some others may not or it may depend on the flags. But I wonder what overhead there could be if it's a simple comparison. I guess it doesn't change much if you aren't calling it really a lot, there inline imo is better because it makes the purpose clearer. But if the function would be called really a lot won't a good compiler optimize the function calls?
Well not just comparison, there are more operations but it's still simple I guess
If you are using a compiler that does profiling based optimization, definitely
Обсуждают сегодня