I am not a Java or C# person and I have been seeing this as purported C++:
What does the ^ mean?
No info in my C# text and no info I could find with Google.
21 12516 NeoPa 32,556
Expert Mod 16PB
Unless I'm mistaken, that doesn't explain the usage as a unary operator Aaron (as in this example). Not that I can help I'm afraid :(
I am not a Java or C# person and I have been seeing this as purported C++:
What does the ^ mean?
No info in my C# text and no info I could find with Google.
In Pascal and Modula the prefix unary '^' means 'pointer to'; but I don't know
what it is supposed to mean in other languages.
kind regards,
Jos
I wonder if they're getting confused with a regular expression part.
Unless I'm mistaken, that doesn't explain the usage as a unary operator Aaron (as in this example). Not that I can help I'm afraid :(
Sure, sure...just make fun of my response but don't offer anything of your own! Bah, a pox upon you!
NeoPa 32,556
Expert Mod 16PB Atli 5,058
Expert 4TB
I've always thought of this as a pointer to a .Net Object. Used only with .Net objects in C++.
I've never seen it used in normal C++, just with that .Net MFC stuff.
Check out the C++ example in the msdn ArrayList documentation.
I'm not all that good with C++ so this may be all wrong :P
I've always thought of this as a pointer to a .Net Object. Used only with .Net objects in C++.
I've never seen it used in normal C++, just with that .Net MFC stuff.
Check out the C++ example in the msdn ArrayList documentation.
I'm not all that good with C++ so this may be all wrong :P
If Microsoft calls this: -
void PrintValues( IEnumerable^ myList );
-
... C++ they've gone completely nutters. 'nuff said.
kind regards,
Jos
Banfa 9,065
Expert Mod 8TB
If Microsoft calls this: -
void PrintValues( IEnumerable^ myList );
-
... C++ they've gone completely nutters. 'nuff said.
It's Managed C++ or C++/CLR which has some sytatic differences from actual C++ but can make .NET calls. It's C++.NET :D
It's Managed C++ or C++/CLR which has some sytatic differences from actual C++ but can make .NET calls. It's C++.NET :D
*eeewww!* Stay from me thou speaker in many tongues! <holds up a wooden cross/>
kind regards,
Jos ( <--- they've gone completely bonkers alright ;-)
When is someone going to ask why this thread is here and not in some other location?
Banfa 9,065
Expert Mod 8TB
When is someone going to ask why this thread is here and not in some other location?
I bet on 25th October at 3:07:24.55 am
NeoPa 32,556
Expert Mod 16PB
Good point Evans. I'll move it to C / C++ forum.
I bet on 25th October at 3:07:24.55 am
Don't ever go into betting Ben.
@NeoPa, I'd have checked with weakness first ...
What I did wwas take the example referred to by JosAH and changed the ^ to an *: -
// Creates and initializes a new ArrayList.
-
ArrayList^ myAL = gcnew ArrayList;
-
//
-
//I changed it to:
-
ArrayList* myAL = gcnew ArrayList;
-
and got an error that you can't use the * indirection with an ArrayList.
With that as a clue I have learned that the ^ declares a reference handle. (what the regular C++ folks call a smart pointer).
As soon as I had the phrase "reference handle" there were suddenly thousands of web pages about this.
Interestingly, the ^ as used here is not an operator. Nor does MSDN ever refer to the ^ when discussing indirection.
Not until you search for reference handle in C++ do you get this.
Hence, the ^ identifies an object on the managed heap whose instances are tracked by the garbage collector whereas the * identifies an object on the CRT heap (and hence can't be used in managed code) whose instances you have to track yourself.
I hope JosAH has a very large silver cross with, perhaps, a lot of garlic.
Banfa 9,065
Expert Mod 8TB
Not until you search for reference handle in C++ do you get this.
Hence, the ^ identifies an object on the managed heap whose instances are tracked by the garbage collector whereas the * identifies an object on the CRT heap (and hence can't be used in managed code) whose instances you have to track yourself.
Thanks for digging that out :-)
I hope JosAH has a very large silver cross with, perhaps, a lot of garlic.
and may be a high power water pistol full of Holy Water
i thought ^ qualifier finds the xor of two integers . didntr know about its use as a unary operator... i am loving TSDN day by day. .
Banfa 9,065
Expert Mod 8TB
i thought ^ qualifier finds the xor of two integers . didntr know about its use as a unary operator... i am loving TSDN day by day. .
IN standard C++ it is the xor operator. Be careful the usage highlighted is a Microsoftism for use in managed code applications.
Good post weaknessforcats. I love C++ but the .NET managed stuff sure mucks things up. I have lots of unmanaged code that I am currently integrating with managed code. I still have some hair to pull out!
As you can see at: http://msdn2.microsoft.com/en-us/lib...orystream.aspx
The are using the caret quite a bit in the .NET FrameWork 3.0. MemoryStream^ memStream = gcnew MemoryStream( 100 );
However, in .NET Framework 1.1 (for example) you need to use: MemoryStream* memStream = __gc new MemoryStream( 100 ); Sign in to post your reply or Sign up for a free account.
Similar topics
by: - ions |
last post by:
hi, i am in the procces of writing a chat program for a main
Assigment, the problem im stuck on is one of the Carets position in a
JTextArea, when i hit the enter key, it appends the msg to the...
|
by: Barry |
last post by:
Retoring Caret Position after text field correction
--------------------------------------------------------------------------------
Hi, my code has the following form -
function...
|
by: Noah |
last post by:
I have a text field in a form. I want the user to be able to click
a DELETE button and have the character at the cursor position deleted.
This would be just as if the user had pressed the Back...
|
by: Paul Gorodyansky |
last post by:
Hi,
Say I have a text in my TEXTAREA box - 01234567890
I want - using script - insert say "abc" in the middle.
Works almost OK in Internet Explorer (with one problem) based on their
example...
|
by: cc |
last post by:
Hi,
Is possible set and get the caret position of cursor in a text field ?
Thanks,
Carlo
|
by: randy |
last post by:
Hi,
I'm trying to set up a richtextbox to behave like the text
area in a web browser, i.e. no caret, and a cursor that
changes depending on what it's hovering over.
I've been setting the...
|
by: Claire |
last post by:
I'm writing an application with custom skinned controls.
I have a text editor form with a rich edit control. Because there's no
toolbuttons in the skinned control set, I have to use normal ones for...
|
by: Jezternz |
last post by:
Okay, so a while back I managed to retrieve it correctly.
In this thread: http://bytes.com/topic/javascript/answers/786211-retrieving-caret-start-end-values#post3127765
However I have found...
|
by: Appazi58 |
last post by:
Hi,
I am trying to develop online chat window. For this I opted for content editable div for sending and receiving messages. I have written javascript to add the image when the user clicks on image....
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
| |