Message from C, C++ talks

July 2019

— So , if you fill an int array with can it be used as memset(array_name,4,sizeof(array_name);

— Then since array_name is of type int

— And size of int is 4 bytes

— Then it will fill each byte of those 4 bytes with 00000100

— 

And hence as per my interpretation, the final value in a single location should be 00000100 00000100 00000100 00000100

— 4 times 00000100

— Somebody check it out on Stackoverflow or somewhere else

— I'm still not sure of what I texted here

— It's a long story.
To tell it short, you can have only one definition of object (google ODR), so you have it in *.cpp file.
But as it's part of your class, you need it to be in the declaration of that class, so you have it in the header.

Actually, since C++17 you can have the definition in the class declaration with inline keyword, that makes guarantee that it will have only one definition (if you don't brake it with macros, then it's UB).

https://en.cppreference.com/w/cpp/language/static

Message permanent page

— Got pretty clear about it. The link is also helpful and give clear idea👍🏻👍🏻Thanks for the help gameraccoon

Message permanent page

— Hey guyss

— Could you help me with compiling one C repo?

— This one, there is a guide ho build it

-> cd src
-> make

— But it says that ldap.h is missing, any ideas why?

— We would also need some more info about what you are trying to compile and the exact error you are getting.

Message permanent page