<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3516962892434596094</id><updated>2024-09-05T17:52:12.616-07:00</updated><category term="C#"/><category term="C# code reverse string"/><category term="C# reverse string"/><category term="dynamic array"/><category term="ref key word"/><category term="reverse string"/><title type='text'>C# Questioned!</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://thanikad.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3516962892434596094/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://thanikad.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>4</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3516962892434596094.post-3701084287004753008</id><published>2009-11-20T00:20:00.000-08:00</published><updated>2009-11-20T00:21:38.832-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><category scheme="http://www.blogger.com/atom/ns#" term="dynamic array"/><title type='text'>C# Dynamic array</title><content type='html'>Sample code to test a dynamic array in C#&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Text;&lt;br /&gt;namespace ConsoleApplication4&lt;br /&gt;{&lt;br /&gt;class Program&lt;br /&gt;{&lt;br /&gt;static void Main(string[] args)&lt;br /&gt;{&lt;br /&gt;DynamicArray da = new DynamicArray();&lt;br /&gt;for (int i = 0; i &lt; 60; i++)&lt;br /&gt;{&lt;br /&gt;da.AddObject(i);&lt;br /&gt;}&lt;br /&gt;da.readArray();&lt;br /&gt;Console.ReadLine();&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;class DynamicArray&lt;br /&gt;{&lt;br /&gt;private object [] _objArray ;&lt;br /&gt;private const int ARRAY_INITIAL_SIZE = 10;&lt;br /&gt;private const int NEXT_INCREMENT_SIZE = 10;&lt;br /&gt;private int _currentIndex = 0;&lt;br /&gt;public DynamicArray()&lt;br /&gt;{&lt;br /&gt;_objArray = new object[ARRAY_INITIAL_SIZE];&lt;br /&gt;}&lt;br /&gt;public void AddObject(object o)&lt;br /&gt;{&lt;br /&gt;if (_currentIndex &lt; _objArray.Length)&lt;br /&gt;{&lt;br /&gt;_objArray[_currentIndex] = o;&lt;br /&gt;_currentIndex++;&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;growArray();&lt;br /&gt;_objArray[_currentIndex] = 0;&lt;br /&gt;_currentIndex++;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;void growArray()&lt;br /&gt;{&lt;br /&gt;object[] tempArray = new object[_objArray.Length + NEXT_INCREMENT_SIZE];&lt;br /&gt;_objArray.CopyTo (tempArray ,0);&lt;br /&gt;_objArray = tempArray;&lt;br /&gt;}&lt;br /&gt;public void readArray()&lt;br /&gt;{&lt;br /&gt;for (int i = 0; i &lt; _objArray.Length ; i++)&lt;br /&gt;{&lt;br /&gt;Console.WriteLine(i.ToString());&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}</content><link rel='replies' type='application/atom+xml' href='http://thanikad.blogspot.com/feeds/3701084287004753008/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3516962892434596094/3701084287004753008' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3516962892434596094/posts/default/3701084287004753008'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3516962892434596094/posts/default/3701084287004753008'/><link rel='alternate' type='text/html' href='http://thanikad.blogspot.com/2009/11/c-dynamic-array.html' title='C# Dynamic array'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3516962892434596094.post-5203916111521688863</id><published>2009-11-18T23:42:00.000-08:00</published><updated>2009-11-19T00:09:45.751-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><category scheme="http://www.blogger.com/atom/ns#" term="ref key word"/><title type='text'>C#. Method arguments with and wothout ref keyword</title><content type='html'>Here is a sample code that explains the difference between method arguments with and without key word ref.&lt;br /&gt;&lt;br /&gt;Copy and past the code in visual studio and run the code to examine the difference.&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Text;&lt;br /&gt;namespace ConsoleApplication2&lt;br /&gt;{&lt;br /&gt;class Program&lt;br /&gt;{&lt;br /&gt;static void Main(string[] args)&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;Person p = new Person(&quot;Ram&quot;,&quot;Gopal&quot;, &quot;Verma&quot;,&quot;male&quot;,new DateTime(1979,2,28));&lt;br /&gt;int a = 10;&lt;br /&gt;ParameterWithoutRef(a, p);&lt;br /&gt;Console.WriteLine(&quot;Method call ParameterWithoutRef starts&quot;);&lt;br /&gt;Console.WriteLine(&quot;FirstName&quot; + p.FirstName ) ;&lt;br /&gt;Console.WriteLine(&quot; value of a&quot; + a.ToString());&lt;br /&gt;Console.WriteLine(&quot;Method call ParameterWithoutRef ends&quot;);&lt;br /&gt;Console.WriteLine(&quot;--------------------------------------------&quot;);&lt;br /&gt;Console.WriteLine(&quot;--------------------------------------------&quot;);&lt;br /&gt;Console.WriteLine(&quot;Method call ParameterWithRef starts&quot;);&lt;br /&gt;ParemeterWithRef(ref a, ref p);&lt;br /&gt;Console.WriteLine(&quot;FirstName&quot; + p.FirstName);&lt;br /&gt;Console.WriteLine(&quot; value of a&quot; + a.ToString());&lt;br /&gt;Console.WriteLine(&quot;Method call ParameterWithRef ends&quot;);&lt;br /&gt;Console.ReadLine();&lt;br /&gt;}&lt;br /&gt;static void ParameterWithoutRef(int integer , Person p)&lt;br /&gt;{&lt;br /&gt;p.FirstName = &quot;Scott&quot;;&lt;br /&gt;integer = 20;&lt;br /&gt;}&lt;br /&gt;static void ParemeterWithRef(ref int integer, ref Person p)&lt;br /&gt;{&lt;br /&gt;p.FirstName = &quot;Scott&quot;;&lt;br /&gt;integer = 50;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;class Person&lt;br /&gt;{&lt;br /&gt;public Person()&lt;br /&gt;{&lt;br /&gt;}&lt;br /&gt;public Person( string firstName, string middleName, string lastName, string gender, DateTime birthDay )&lt;br /&gt;{&lt;br /&gt;this._firstName = firstName;&lt;br /&gt;this._lastName = lastName;&lt;br /&gt;this._middleName = middleName;&lt;br /&gt;this._gender = gender;&lt;br /&gt;this._birthday = birthDay;&lt;br /&gt;}&lt;br /&gt;#region PersonClassPrivateDetails&lt;br /&gt;private String _firstName;&lt;br /&gt;private String _middleName;&lt;br /&gt;public String MiddleName&lt;br /&gt;{&lt;br /&gt;get { return _middleName; }&lt;br /&gt;set { _middleName = value; }&lt;br /&gt;}&lt;br /&gt;private String _lastName;&lt;br /&gt;public String LastName&lt;br /&gt;{&lt;br /&gt;get { return _lastName; }&lt;br /&gt;set { _lastName = value; }&lt;br /&gt;}&lt;br /&gt;private String _gender;&lt;br /&gt;public String Gender&lt;br /&gt;{&lt;br /&gt;get { return _gender; }&lt;br /&gt;set { _gender = value; }&lt;br /&gt;}&lt;br /&gt;private DateTime _birthday;&lt;br /&gt;public DateTime Birthday&lt;br /&gt;{&lt;br /&gt;get { return _birthday; }&lt;br /&gt;set { _birthday = value; }&lt;br /&gt;}&lt;br /&gt;public string FirstName&lt;br /&gt;{&lt;br /&gt;set&lt;br /&gt;{&lt;br /&gt;_firstName = value;&lt;br /&gt;}&lt;br /&gt;get&lt;br /&gt;{&lt;br /&gt;return _firstName;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;#endregion&lt;br /&gt;public string getFullName ()&lt;br /&gt;{&lt;br /&gt;return _firstName + _lastName;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}</content><link rel='replies' type='application/atom+xml' href='http://thanikad.blogspot.com/feeds/5203916111521688863/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3516962892434596094/5203916111521688863' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3516962892434596094/posts/default/5203916111521688863'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3516962892434596094/posts/default/5203916111521688863'/><link rel='alternate' type='text/html' href='http://thanikad.blogspot.com/2009/11/c-method-arguments-with-and-wothout-ref.html' title='C#. Method arguments with and wothout ref keyword'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3516962892434596094.post-1281741518955537312</id><published>2009-11-13T05:01:00.000-08:00</published><updated>2009-11-14T02:02:10.089-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C# code reverse string"/><category scheme="http://www.blogger.com/atom/ns#" term="C# reverse string"/><category scheme="http://www.blogger.com/atom/ns#" term="reverse string"/><title type='text'>C# Reverse a string</title><content type='html'>If somebody ask you to write a simple method that reverse an input string, here is the code.&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Text;&lt;br /&gt;namespace ConsoleApplication2&lt;br /&gt;{&lt;br /&gt;class Program&lt;br /&gt;{&lt;br /&gt;static void Main(string[] args)&lt;br /&gt;{&lt;br /&gt;string result = ReverseString(&quot;i am fine&quot;);&lt;br /&gt;}&lt;br /&gt;public static string ReverseString(string input)&lt;br /&gt;{&lt;br /&gt;char[] output = input.ToCharArray();&lt;br /&gt;char[] result = new char [output.Length ];&lt;br /&gt;int j = 0;&lt;br /&gt;for (int i = output.Length - 1 ; i &gt; 0; i--)&lt;br /&gt;{&lt;br /&gt;result[j] = (char)output[i];&lt;br /&gt;j++;&lt;br /&gt;}&lt;br /&gt;return new string(result);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;,&lt;br /&gt;Another simple way&lt;br /&gt;&lt;br /&gt;public static string Reverse( string s ){    char[] charArray = s.ToCharArray();    Array.Reverse( charArray );    return new string( charArray );}</content><link rel='replies' type='application/atom+xml' href='http://thanikad.blogspot.com/feeds/1281741518955537312/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3516962892434596094/1281741518955537312' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3516962892434596094/posts/default/1281741518955537312'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3516962892434596094/posts/default/1281741518955537312'/><link rel='alternate' type='text/html' href='http://thanikad.blogspot.com/2009/11/c-reverse-string.html' title='C# Reverse a string'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3516962892434596094.post-2572434561871821542</id><published>2008-03-16T05:22:00.000-07:00</published><updated>2008-03-16T05:24:16.919-07:00</updated><title type='text'>Delegates and Events in C#</title><content type='html'>&lt;span style=&quot;font-weight: bold;&quot;&gt;Delegates:&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://thanikad.blogspot.com/feeds/2572434561871821542/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3516962892434596094/2572434561871821542' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3516962892434596094/posts/default/2572434561871821542'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3516962892434596094/posts/default/2572434561871821542'/><link rel='alternate' type='text/html' href='http://thanikad.blogspot.com/2008/03/delegates-and-events-in-c.html' title='Delegates and Events in C#'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry></feed>