So I've been writing C++ code for a long time, yet there are some things I've realized recently (after a long, long fling with c) that I don't quite get.
Why the hell is everything preceeded with underscores in C++?? I.e. ___int32 or something like that. What the hell is the point of that
Also, anytime I've needed to cast something, I've now realized that I was doing it c-style? I.e.
Now that I'm coming back to C++ and considering using it for more advanced programming (worker threads, thread classes, etc.), I've seen a lot of that underscore shit and weird casts that I'm not familiar with, though I used (basic) C++ for quite some time.
I.e. c++ casting:
I feel like there's just something I'm not getting about C++, now that I've been using C for so long (because of college, I'm a junior and a CS major).
However, when I took my second data structures course (which was a C++ course), I didn't ever see any of that underscore shit or super weird casting.
Also, what the hell is a "typedef"?
Thanks!
Why the hell is everything preceeded with underscores in C++?? I.e. ___int32 or something like that. What the hell is the point of that
Also, anytime I've needed to cast something, I've now realized that I was doing it c-style? I.e.
Code Select
struct Arg *arg = (struct Arg *) malloc(sizeof(struct Arg));
void *ptr;
ptr = (struct Arg *) arg;
Now that I'm coming back to C++ and considering using it for more advanced programming (worker threads, thread classes, etc.), I've seen a lot of that underscore shit and weird casts that I'm not familiar with, though I used (basic) C++ for quite some time.
I.e. c++ casting:
Code Select
const char *c = "text";
char *str = const_cast<char *> (c);
cout << str << '\n';
I feel like there's just something I'm not getting about C++, now that I've been using C for so long (because of college, I'm a junior and a CS major).
However, when I took my second data structures course (which was a C++ course), I didn't ever see any of that underscore shit or super weird casting.
Also, what the hell is a "typedef"?
Thanks!