Once more unto the C++, dear friends, once more
-
Yep! I know that:) but never had any problem with it. But ^ in C++/CLI, also called hat or cap, looks just plain ugly.
For some odd reason ^ replaced the _gc in the first CLI.
The narrow specialist in the broad sense of the word is a complete idiot in the narrow sense of the word. Advertise here – minimum three posts per day are guaranteed.
-
For some odd reason ^ replaced the _gc in the first CLI.
The narrow specialist in the broad sense of the word is a complete idiot in the narrow sense of the word. Advertise here – minimum three posts per day are guaranteed.
Deyan Georgiev wrote:
replaced the _gc
Which was even worse :).
-
Deyan Georgiev wrote:
replaced the _gc
Which was even worse :).
Rama Krishna Vavilala wrote:
Which was even worse
I dissagree. Underscores are a standard-sanctioned way to extend the language. There was really no reason to break compatibility with Managed C++ and introduce "C++/CLI".
-
I have not written any C++ code since 2001. Now I'm dragging one of my old dll's out of mothballs to add some new features. Some where in those 8 absent years the garbage collector or my brain declared C++ syntax of no use and deleted it for me. Now I'm staring at my code wondering what all the hieroglyphics are for. Let's see there's this * guy. He's got something to do with pointers. It's attached or next to some of my variables. Then there's ::, <<, >>, wait.... wait, it's coming back to me.... "<<" is super less than. Got it moving on. Then I run into ^. Oh come on! Who thought ^ was a good idea? Linker? what is that? You mean I have to tell this linker of yours where to look for things just so I can compile? There isn't just a magic "make it go button"? This is going to be a long day. Better load up on the caffeine.
Latest toy built for fun: Web Lens Best feature: Full size images when using Google image search.
pelnor wrote:
Then I run into ^. Oh come on! Who thought ^ was a good idea?
It's a chinese pointer.
This signature was proudly tested on animals.
-
^ is XOR in C++, vs exponentiation in arithmetic. It's retarded.
The latest nation. Procrastination.
Dan Neely wrote:
It's retarded.
Agreed. Although, in the 600K to 800K lines of C++ I have produced I do not recall ever using that one time. I would have had to look it up if I saw it..
John
-
I have not written any C++ code since 2001. Now I'm dragging one of my old dll's out of mothballs to add some new features. Some where in those 8 absent years the garbage collector or my brain declared C++ syntax of no use and deleted it for me. Now I'm staring at my code wondering what all the hieroglyphics are for. Let's see there's this * guy. He's got something to do with pointers. It's attached or next to some of my variables. Then there's ::, <<, >>, wait.... wait, it's coming back to me.... "<<" is super less than. Got it moving on. Then I run into ^. Oh come on! Who thought ^ was a good idea? Linker? what is that? You mean I have to tell this linker of yours where to look for things just so I can compile? There isn't just a magic "make it go button"? This is going to be a long day. Better load up on the caffeine.
Latest toy built for fun: Web Lens Best feature: Full size images when using Google image search.
And if you put “&” before some variable, it will returns a strange combination of letters and numbers. I usually use this cute property for getting random numbers in runtime – works great!
The narrow specialist in the broad sense of the word is a complete idiot in the narrow sense of the word. Advertise here – minimum three posts per day are guaranteed.
-
Rama Krishna Vavilala wrote:
Which was even worse
I dissagree. Underscores are a standard-sanctioned way to extend the language. There was really no reason to break compatibility with Managed C++ and introduce "C++/CLI".
Nemanja Trifunovic wrote:
Underscores are a standard-sanctioned way to extend the language
I agree with that. But there was no need for that (_gc keyword) in the first place. The whole thing could have been a lot simpler. The code simply looked ugly.
Nemanja Trifunovic wrote:
There was really no reason to break compatibility with Managed C++ and introduce "C++/CLI".
Managed C++ was ugly so was C++/CLI. So no arguments there.
-
I have not written any C++ code since 2001. Now I'm dragging one of my old dll's out of mothballs to add some new features. Some where in those 8 absent years the garbage collector or my brain declared C++ syntax of no use and deleted it for me. Now I'm staring at my code wondering what all the hieroglyphics are for. Let's see there's this * guy. He's got something to do with pointers. It's attached or next to some of my variables. Then there's ::, <<, >>, wait.... wait, it's coming back to me.... "<<" is super less than. Got it moving on. Then I run into ^. Oh come on! Who thought ^ was a good idea? Linker? what is that? You mean I have to tell this linker of yours where to look for things just so I can compile? There isn't just a magic "make it go button"? This is going to be a long day. Better load up on the caffeine.
Latest toy built for fun: Web Lens Best feature: Full size images when using Google image search.
It's even better now. As well as pointers and references you now have handles. :) Not that I've ever worked with managed C++ or whatever its called now but I bet it's fun trying to get a handle on pointers to references of pointers to handles. Thing*&^thingy=&somethingNasty; (A while since I did C++ so the above is probably wrong.....)
-
I have not written any C++ code since 2001. Now I'm dragging one of my old dll's out of mothballs to add some new features. Some where in those 8 absent years the garbage collector or my brain declared C++ syntax of no use and deleted it for me. Now I'm staring at my code wondering what all the hieroglyphics are for. Let's see there's this * guy. He's got something to do with pointers. It's attached or next to some of my variables. Then there's ::, <<, >>, wait.... wait, it's coming back to me.... "<<" is super less than. Got it moving on. Then I run into ^. Oh come on! Who thought ^ was a good idea? Linker? what is that? You mean I have to tell this linker of yours where to look for things just so I can compile? There isn't just a magic "make it go button"? This is going to be a long day. Better load up on the caffeine.
Latest toy built for fun: Web Lens Best feature: Full size images when using Google image search.
I am converting a compiler and language runtime written in C++ into C# - that's fun :^)
-
pelnor wrote:
There isn't just a magic "make it go button"?
F5 and a properly configured workspace?
Propery configured was the challenge. I way jumping the old project over several versions of VS. Things did not go as smooth as i hoped for. But with google by my side i can't fail.
Latest toy built for fun: Web Lens Best feature: Full size images when using Google image search.
-
-
Dan Neely wrote:
It's retarded.
Agreed. Although, in the 600K to 800K lines of C++ I have produced I do not recall ever using that one time. I would have had to look it up if I saw it..
John
-
Nemanja Trifunovic wrote:
Underscores are a standard-sanctioned way to extend the language
I agree with that. But there was no need for that (_gc keyword) in the first place. The whole thing could have been a lot simpler. The code simply looked ugly.
Nemanja Trifunovic wrote:
There was really no reason to break compatibility with Managed C++ and introduce "C++/CLI".
Managed C++ was ugly so was C++/CLI. So no arguments there.
Rama Krishna Vavilala wrote:
ugly
I find all C-based languages to be ugly (some more than others). It is not about beauty, but usefulness. Managed C++ is useful for some scenarios and that's what matters. I'd rather use beautiful Haskell but it just does not let me get my job done.
-
I know I've used it for something before, although I'm not sure what it was. Toggling a bitflag without knowing it's original value???
The latest nation. Procrastination.
what about swapping 2 values without a temp variable:
char\* start = str; char\* end = str + (strlen(str) - 1); while (start < end) { \*start ^= \*end; \*end ^= \*start; \*start++ ^= \*end--; } return str;
Pete
-
what about swapping 2 values without a temp variable:
char\* start = str; char\* end = str + (strlen(str) - 1); while (start < end) { \*start ^= \*end; \*end ^= \*start; \*start++ ^= \*end--; } return str;
Pete
I remember that you can do this with XORs however for code readability I would never do that in a program.
John
-
I remember that you can do this with XORs however for code readability I would never do that in a program.
John
John M. Drescher wrote:
you can do this with XORs however for code readability I would never do that in a program
Meh, pack it into a well named inline function, such as
swap_in_place()
and the readability problem is solved. -
I am converting a compiler and language runtime written in C++ into C# - that's fun :^)
I have lots of fun doing the reverse. :laugh:
John
-
Dan Neely wrote:
It's retarded.
Agreed. Although, in the 600K to 800K lines of C++ I have produced I do not recall ever using that one time. I would have had to look it up if I saw it..
John
I’m not agreed. It was all over my code for almost three years. XOR is very heavily used in the cryptography.
The narrow specialist in the broad sense of the word is a complete idiot in the narrow sense of the word. Advertise here – minimum three posts per day are guaranteed.
-
I’m not agreed. It was all over my code for almost three years. XOR is very heavily used in the cryptography.
The narrow specialist in the broad sense of the word is a complete idiot in the narrow sense of the word. Advertise here – minimum three posts per day are guaranteed.
Deyan Georgiev wrote:
XOR is very heavily used in the cryptography.
You just reminded me.. I actually may have to dig into this soon to interface with a medical workstation. I will probably just use a standard library however.
John
-
I have not written any C++ code since 2001. Now I'm dragging one of my old dll's out of mothballs to add some new features. Some where in those 8 absent years the garbage collector or my brain declared C++ syntax of no use and deleted it for me. Now I'm staring at my code wondering what all the hieroglyphics are for. Let's see there's this * guy. He's got something to do with pointers. It's attached or next to some of my variables. Then there's ::, <<, >>, wait.... wait, it's coming back to me.... "<<" is super less than. Got it moving on. Then I run into ^. Oh come on! Who thought ^ was a good idea? Linker? what is that? You mean I have to tell this linker of yours where to look for things just so I can compile? There isn't just a magic "make it go button"? This is going to be a long day. Better load up on the caffeine.
Latest toy built for fun: Web Lens Best feature: Full size images when using Google image search.
pelnor wrote:
Then I run into ^. Oh come on! Who thought ^ was a good idea?
That's in C# too. And I've used it. (If you're going to harp on symbols, how about
&
meaning concatenate in VB? Or the difference between \ and /? Of course, just like in C++ and C#, once you know them, you know them.)