Click here to Skip to main content
15,908,274 members
Home / Discussions / C#
   

C#

 
Questionweb design Pin
momoo26-Oct-05 16:36
momoo26-Oct-05 16:36 
AnswerRe: web design Pin
Christian Graus26-Oct-05 16:44
protectorChristian Graus26-Oct-05 16:44 
QuestionPlease help - problem on using FileSystemWatcher Pin
Tigger9926-Oct-05 16:04
Tigger9926-Oct-05 16:04 
AnswerRe: Please help - problem on using FileSystemWatcher Pin
Christian Graus26-Oct-05 16:13
protectorChristian Graus26-Oct-05 16:13 
GeneralRe: Please help - problem on using FileSystemWatcher Pin
Tigger9926-Oct-05 16:16
Tigger9926-Oct-05 16:16 
GeneralRe: Please help - problem on using FileSystemWatcher Pin
Christian Graus26-Oct-05 16:19
protectorChristian Graus26-Oct-05 16:19 
Questionprogram execution Pin
Zjaded26-Oct-05 15:24
Zjaded26-Oct-05 15:24 
AnswerRe: program execution Pin
leppie26-Oct-05 15:28
leppie26-Oct-05 15:28 
AnswerRe: program execution Pin
Christian Graus26-Oct-05 15:51
protectorChristian Graus26-Oct-05 15:51 
Questionsystem.array as parameter Pin
Member 239309226-Oct-05 14:56
Member 239309226-Oct-05 14:56 
AnswerRe: system.array as parameter Pin
leppie26-Oct-05 15:00
leppie26-Oct-05 15:00 
GeneralRe: system.array as parameter Pin
Member 239309226-Oct-05 15:12
Member 239309226-Oct-05 15:12 
AnswerRe: system.array as parameter Pin
leppie26-Oct-05 15:26
leppie26-Oct-05 15:26 
QuestionC# and mysql Pin
vandread126-Oct-05 13:51
vandread126-Oct-05 13:51 
AnswerRe: C# and mysql Pin
Christian Graus26-Oct-05 13:55
protectorChristian Graus26-Oct-05 13:55 
AnswerRe: C# and mysql Pin
Wjousts26-Oct-05 14:50
Wjousts26-Oct-05 14:50 
AnswerRe: C# and mysql Pin
seee sharp26-Oct-05 18:21
seee sharp26-Oct-05 18:21 
GeneralRe: C# and mysql Pin
Jeason Zhao27-Oct-05 4:26
Jeason Zhao27-Oct-05 4:26 
GeneralRe: C# and mysql Pin
vandread12-Nov-05 8:12
vandread12-Nov-05 8:12 
QuestionC# ArrayList Pin
Doncp26-Oct-05 12:38
Doncp26-Oct-05 12:38 
AnswerRe: C# ArrayList Pin
Wjousts26-Oct-05 12:48
Wjousts26-Oct-05 12:48 
AnswerRe: C# ArrayList Pin
enjoycrack26-Oct-05 12:49
enjoycrack26-Oct-05 12:49 
AnswerRe: C# ArrayList Pin
Edbert P26-Oct-05 12:57
Edbert P26-Oct-05 12:57 
In your code, you did not instantiate a new foo object, instead you are modifying the foo.strName only.
An ArrayList stores reference to your object, therefore if you store two reference to the same object they will result in the same object.

Try this instead:
ArrayList myObj = new ArrayList();

ClassName foo = new ClassName(); //Or however you instantiate a new foo object
foo.strName = "name";
myObj.Add(foo);

...

foo = new ClassName();           //Instantiate a new class with the same object name (foo)
foo.strName = "newname";
myObj.Add(foo);


This will result in two different objects which references are contained in your myObj ArrayList.
Does that help?

Edbert P.
Sydney, Australia

-- modified at 18:58 Wednesday 26th October, 2005
GeneralRe: C# ArrayList Pin
Doncp27-Oct-05 6:01
Doncp27-Oct-05 6:01 
QuestionP/Invoke problem Pin
Mark Tutt26-Oct-05 12:19
Mark Tutt26-Oct-05 12:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.