Click here to Skip to main content
15,900,482 members
Home / Discussions / C#
   

C#

 
GeneralRe: Multithreading problem Pin
Judah Gabriel Himango21-Feb-06 6:56
sponsorJudah Gabriel Himango21-Feb-06 6:56 
GeneralRe: Multithreading problem Pin
Le centriste21-Feb-06 7:10
Le centriste21-Feb-06 7:10 
AnswerSOLVED (Unrelated to multithreading) Pin
Le centriste21-Feb-06 7:11
Le centriste21-Feb-06 7:11 
QuestionArray of pointers/references to another array Pin
naveed21-Feb-06 4:35
naveed21-Feb-06 4:35 
AnswerRe: Array of pointers/references to another array Pin
Le centriste21-Feb-06 4:53
Le centriste21-Feb-06 4:53 
GeneralRe: Array of pointers/references to another array Pin
naveed21-Feb-06 5:06
naveed21-Feb-06 5:06 
GeneralRe: Array of pointers/references to another array Pin
Le centriste21-Feb-06 5:10
Le centriste21-Feb-06 5:10 
GeneralRe: Array of pointers/references to another array Pin
naveed21-Feb-06 6:46
naveed21-Feb-06 6:46 
Thanks, just tested it and it works like you said.

<br />
namespace ListRef<br />
{<br />
	class Person<br />
	{<br />
		public string name;<br />
		public int id;<br />
<br />
		public Person(string name, int id)<br />
		{<br />
			this.name = name;<br />
			this.id = id;<br />
		}<br />
	}<br />
	<br />
	class Program<br />
	{<br />
		static void Print(List<Person> l, string s)<br />
		{<br />
			int i=0;<br />
			System.Console.WriteLine("\n --- {0}: --- ", s);<br />
			foreach(Person p in l)<br />
			{<br />
				System.Console.WriteLine("{0} {1} {2}", i, p.id, p.name);<br />
				i++;<br />
			}<br />
		}<br />
		<br />
		static void Main(string[] args)<br />
		{<br />
			List<Person> a = new List<Person>();<br />
			a.Add( new Person("jon", 1) );<br />
			a.Add( new Person("mary", 2) );<br />
			a.Add( new Person("hill", 3) );<br />
<br />
			List<Person> b = new List<Person>(a);<br />
			List<Person> c = new List<Person>();<br />
<br />
			Person[] x = new Person[] { new Person("abe", 5), new Person("jim", 6) };<br />
<br />
			a.AddRange(x);<br />
<br />
			c.AddRange(a);<br />
<br />
			Print(a, "a");<br />
			Print(b, "b");<br />
			Print(c, "c");<br />
<br />
			c[4].id = 555;<br />
<br />
			Print(a, "a");<br />
			Print(b, "b");<br />
			Print(c, "c");<br />
		}<br />
	}<br />
}<br />

QuestionWindows Form from Outlook Pin
tanishq151021-Feb-06 4:29
tanishq151021-Feb-06 4:29 
QuestionCustom textbox with dropdownlist behavior Pin
hansdredd21-Feb-06 4:28
hansdredd21-Feb-06 4:28 
AnswerRe: Custom textbox with dropdownlist behavior Pin
hooray21-Feb-06 5:18
hooray21-Feb-06 5:18 
GeneralRe: Custom textbox with dropdownlist behavior Pin
hansdredd21-Feb-06 20:25
hansdredd21-Feb-06 20:25 
GeneralRe: Custom textbox with dropdownlist behavior Pin
Roy Heil22-Feb-06 7:46
professionalRoy Heil22-Feb-06 7:46 
GeneralRe: Custom textbox with dropdownlist behavior Pin
hansdredd23-Feb-06 20:52
hansdredd23-Feb-06 20:52 
QuestionWhy doesn't the compiler flag classes with public unlong-s as erroneous although the assembly is CLS compliant? Pin
Vikram A Punathambekar21-Feb-06 3:53
Vikram A Punathambekar21-Feb-06 3:53 
AnswerRe: Why doesn't the compiler flag classes with public unlong-s as erroneous although the assembly is CLS compliant? Pin
Judah Gabriel Himango21-Feb-06 6:30
sponsorJudah Gabriel Himango21-Feb-06 6:30 
GeneralRe: Why doesn't the compiler flag classes with public unlong-s as erroneous although the assembly is CLS compliant? Pin
Vikram A Punathambekar21-Feb-06 16:31
Vikram A Punathambekar21-Feb-06 16:31 
GeneralRe: Why doesn't the compiler flag classes with public unlong-s as erroneous although the assembly is CLS compliant? Pin
Judah Gabriel Himango21-Feb-06 17:12
sponsorJudah Gabriel Himango21-Feb-06 17:12 
GeneralRe: Why doesn't the compiler flag classes with public unlong-s as erroneous although the assembly is CLS compliant? Pin
Vikram A Punathambekar21-Feb-06 21:15
Vikram A Punathambekar21-Feb-06 21:15 
Questionlimiting the number of decimal places produced converting a double to a string. Pin
Dan Neely21-Feb-06 3:50
Dan Neely21-Feb-06 3:50 
AnswerRe: limiting the number of decimal places produced converting a double to a string. Pin
Vikram A Punathambekar21-Feb-06 4:07
Vikram A Punathambekar21-Feb-06 4:07 
GeneralRe: limiting the number of decimal places produced converting a double to a string. Pin
Dan Neely21-Feb-06 6:54
Dan Neely21-Feb-06 6:54 
GeneralRe: limiting the number of decimal places produced converting a double to a string. Pin
Vikram A Punathambekar21-Feb-06 16:28
Vikram A Punathambekar21-Feb-06 16:28 
QuestionOh... Joy! App failing and I don't know why Pin
Colin Angus Mackay21-Feb-06 3:43
Colin Angus Mackay21-Feb-06 3:43 
QuestionComboBox Enter Key Detection Issue Pin
Darryl Borden21-Feb-06 3:17
Darryl Borden21-Feb-06 3:17 

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.