Code: Select all
#if !defined(internal)// static function calls, i know std has std::internal
#define internal static
#endif
#define global_variable static// self explanatory
#define local_persist static// local in a scope
Code: Select all
#if !defined(internal)// static function calls, i know std has std::internal
#define internal static
#endif
#define global_variable static// self explanatory
#define local_persist static// local in a scope
I was watching a professional coding in C and he does all kinds of typedef, and defines, I thought it was weird, but at the same time kinda interesting. His reasoning was so he has better clarity. Each to their own i guessalbinopapa wrote:Nope, I just use static as is. Why would you want to alias it?
There are things you can do to type less (in other words, being lazy). Sometimes there are variables that have long names and if you use then often, it's a pain to type out all the time. These little tricks can make life easier.Ziltwix wrote:Whatcha doing here, MrGodin?
Yeah, i haven't used that yet. Don't really see a difference, just new terminology ?.albinopapa wrote:instead of using typedef, you can also use using.
old way
typedef std::string sString;
new way
using sString = std::string;