Category : c++

I’m using a library that features callbacks extensively. Unfortunately, many of the methods accept callbacks in two or more formats. This was done as a convenience, but a side-effect is that it prevents the use of polymorphic lambdas (lambdas with parameters declared as auto). Example: namespace Library { struct Gear final {}; struct Bolt final ..

Read more

I was studying pointers in arithmetic today, and I got stuck at a point where I didn’t understand a thing. I initialized an integer variable with "10" as its value inside it. I declared another pointer variable (*p) in which I stored the address of "a" and then I added 3 to it. According to ..

Read more

Three nodes Node1, Node2 and Node3 are connected in point to point fashion as – Node1–>Node2–>Node3. Node1 is the source node and generates packets at the rate of 50 packets/sec. Node2 simply forwards the packets to Node3 which is the destination node. And Node3 deletes all the packets, and for every tenth packet received by ..

Read more

I have a single project called MyProject.exe which depends on a static lib called MyDep.lib. MyDep.lib contains a function called MyDepFunction() which uses functions in another dependency called SubDep.lib. As I understand it, if MyDepFunction() is never utilised by any part of MyDep.lib used by MyProject.exe it is sufficient to only link against MyDep.lib. But ..

Read more