|
by: Tony Johansson |
last post by:
Hello!
I'm reading in a book about C++ and that is something that sound strange.
It says "Pointers have reference-assignment semantics similar to those in
Java. For example, after the assignment
Student* john = michael;
both john and michael share the same object. This type of an assignment is
different then value-assignmnet semantics used by class variables, as in
|
by: M |
last post by:
I am trying to copy the values of one hashtable to another.
I ran into a read only error when using the IDictionaryEnumerator.
while (myHashEnumerator.MoveNext()){
while (fsHashEnumerator.MoveNext()){
if (myHashEnumerator.Key == fsHashEnumerator.Key)
{
myHashEnumerator.Value = fsHashEnumerator.Value;
}
|
by: A. Burch |
last post by:
I'm wanting to use a Hashtable. I have 2 (keys, objectvalues) pairs of data
to store. I'm using a static declartion for the Hashtable the instance of
the class that is the object. If I try and retreive the first object after
storing after the 2 (key, objectvalues) are stored I always get the last
object value stored. Why doesn't qrec = (Q)HT give a copy of the
last or in this code the second of the 2 objects? How should the code be...
|
by: A. Burch |
last post by:
I posted early about Hashtable use and the shallow/deep copy and storing a
reference answered that question.
I've got a larger implementation of this, but am not sure why I'm getting
this error. Object reference not set to an instance of an object. I don't
know what I'm missing. What needs to be fixed for this implementation to
work?
using System;
using System.Collections;
|
by: fperfect13 |
last post by:
Hi,
I wanted to perform a deep copy of an array. Searching on google I ran
into different opinions :
C# Interview Questions
(http://blogs.wwwcoder.com/tsvmadhav/archive/2005/04/08/2882.aspx)
10.What's the difference between the System.Array.CopyTo() and
System.Array.Clone()?
|
|
by: Fred |
last post by:
I'm trying to build a hashtable and a arraylist as object value
I'm not able to retrieve stored object from the hashtable.
Hashtable mp = new Hashtable(); // THE HASHTABLE
ArrayList atemp = new ArrayList(); // THE ARRAY
StreamWriter sw = new StreamWriter(@"C:\temp\fred.html");
|
by: oDDskOOL |
last post by:
I realized today that the Hashtable.Clone only produces a shallow
copy... that makes me go mad that M$ doesn't even provide a deep copy
ctor for the Hashtable class !
mighty tech ducks might reply "oh but what if the types in hastable
don't have copy ctors defined? that could lead to dangerous
situations".
well, but was it a significant effort to provide a copy ctor / deep
clone method to this class for objects that provide the...
|
by: Curtis |
last post by:
Does anyone have any examples of serializing a hashtable? I tried to make a
copy of the hash table using the .clone method but per MS documention it
creates a shallow copy of the object. I am trying to make a full or deep
copy of the master hashtable any examples would be great.
Thanks,
Curtis
|
by: raylopez99 |
last post by:
The "C# Cookbook" (O'Reilly / Jay Hilyard), section 3.26, is on deep
cloning versus shallow cloning. The scanned pages of this book are
found here: http://www.sendspace.com/file/mjyocg (Word format, 3 pp)
My question, coming from a C++ background where deep copying is done,
is why in C# you would do either deep or shallow copying as suggested
by O'Reilly (using the "ICloneable" inhereited interface), at least
for the .NET framework.
...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
|