Pointer concept in c#

Posted by Amritha444 under C# on 12/20/2010 | Points: 10 | Views : 2109 | Status : [Member] | Replies : 2
Is pointer concept is possible in c#.

Thanks in advance




Responses

Posted by: Chvrsri on: 12/20/2010 [Member] [Moderator] [MVP] Silver | Points: 25

Up
0
Down
Hi

Follow these Link you get a lot of info and finally u will get the answer you were looking for !!!

http://www.c-sharpcorner.com/UploadFile/pcurnow/usingpointers10022007082330AM/usingpointers.aspx

http://www.dotnetspider.com/resources/313-Pointers-C-writing-Unsafe-code.aspx

Thanks,
Radha Srikanth

Amritha444, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Lalji_mer on: 12/20/2010 [Member] Bronze | Points: 25

Up
0
Down
Hi,
Show this link about pointer Concept and example

http://msdn.microsoft.com/en-us/library/y31yhkeb.aspx
http://www.suite101.com/article.cfm/c_sharp/83033/2

Here how to create pointer in C#.net
http://www.ehow.com/how_2091617_create-pointer-c.html
Show here Example
//Compilation

//CSC FileName.CS

using System;

class Test
{
unsafe static void WriteLocations()
{
int *p;
int i;
i = 10;
p = &i;

string addr;
addr = int.Format((int) p, "X");
//To Format the Pointer to a String

Console.WriteLine(addr);
Console.WriteLine(*p);

*p = 333;
Console.WriteLine(i);
//Change the Value using Pointer

i = *(&i) + 10;
Console.WriteLine(i);

}

static void Main()
{
WriteLocations();
}
}


LP MER

Amritha444, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response