Click here to Skip to main content
15,611,970 members
Home / Discussions / C#
   

C#

 
GeneralRe: Persist data across pages using Web Table Control Pin
caheo18-Jan-04 13:55
caheo18-Jan-04 13:55 
GeneralRe: Persist data across pages using Web Table Control Pin
Heath Stewart19-Jan-04 3:00
protectorHeath Stewart19-Jan-04 3:00 
GeneralAdded method with a wizard Pin
Anonymous18-Jan-04 10:06
Anonymous18-Jan-04 10:06 
GeneralRe: Added method with a wizard Pin
Mazdak18-Jan-04 10:19
Mazdak18-Jan-04 10:19 
GeneralRe: Added method with a wizard Pin
leppie18-Jan-04 11:35
leppie18-Jan-04 11:35 
GeneralRe: Added method with a wizard Pin
Mazdak18-Jan-04 20:12
Mazdak18-Jan-04 20:12 
GeneralRe: Added method with a wizard Pin
Guillermo Rivero18-Jan-04 10:32
Guillermo Rivero18-Jan-04 10:32 
GeneralC# - Multidimensionnal array of pointers Pin
Orahn18-Jan-04 7:05
Orahn18-Jan-04 7:05 
Hello,

i'm having difficulties to use a multidimensional array of pointers in C#. The objective would be to have an array of pointer (2D) using the type TestClass. Here is the example test code that doesn't work:

public class MainClass
{
///
/// The main entry point for the application.
///

[STAThread]
static void Main(string[] args)
{
unsafe
{
TestClass obj = new TestClass(2);
TestClass *[,] ptrArray = new TestClass *[2,2];
ptrArray[1,1] = &obj;
ptrArray[1,1]->Display();
}

}
}

public class TestClass
{
private int data;

public TestClass (int d) { data = d; }

public void Display() { Console.WriteLine(data.ToString()); }
}


The following error is encountered:

Cannot take the address or size of a variable of a managed type.

Thanks for helping.
GeneralRe: C# - Multidimensionnal array of pointers Pin
leppie18-Jan-04 10:04
leppie18-Jan-04 10:04 
GeneralRe: C# - Multidimensionnal array of pointers Pin
Orahn18-Jan-04 10:09
Orahn18-Jan-04 10:09 
GeneralRe: C# - Multidimensionnal array of pointers Pin
leppie18-Jan-04 10:13
leppie18-Jan-04 10:13 
GeneralRe: C# - Multidimensionnal array of pointers Pin
Heath Stewart18-Jan-04 11:49
protectorHeath Stewart18-Jan-04 11:49 
GeneralRe: C# - Multidimensionnal array of pointers Pin
Orahn18-Jan-04 18:58
Orahn18-Jan-04 18:58 
GeneralRe: C# - Multidimensionnal array of pointers Pin
pat2918-Jan-04 18:58
pat2918-Jan-04 18:58 
GeneralExecuteNonQuery() problem in C# Pin
Qamarwis18-Jan-04 5:10
Qamarwis18-Jan-04 5:10 
GeneralRe: ExecuteNonQuery() problem in C# Pin
Nick Parker18-Jan-04 5:39
protectorNick Parker18-Jan-04 5:39 
GeneralRe: ExecuteNonQuery() problem in C# Pin
Guillermo Rivero18-Jan-04 6:58
Guillermo Rivero18-Jan-04 6:58 
GeneralRe: ExecuteNonQuery() problem in C# Pin
india_nagpur118-Jan-04 20:04
india_nagpur118-Jan-04 20:04 
GeneralCustomCollection + Auto code generation in designer Pin
James Simpson18-Jan-04 3:05
James Simpson18-Jan-04 3:05 
GeneralRe: CustomCollection + Auto code generation in designer Pin
Heath Stewart18-Jan-04 11:45
protectorHeath Stewart18-Jan-04 11:45 
GeneralRe: CustomCollection + Auto code generation in designer Pin
James Simpson18-Jan-04 11:50
James Simpson18-Jan-04 11:50 
Generalado.net Pin
Roger Alsing18-Jan-04 1:30
Roger Alsing18-Jan-04 1:30 
GeneralRe: ado.net Pin
Arjan Einbu18-Jan-04 4:10
Arjan Einbu18-Jan-04 4:10 
GeneralRe: ado.net Pin
Heath Stewart18-Jan-04 11:31
protectorHeath Stewart18-Jan-04 11:31 
Generalcreating a dll with win32 functions, and calling it from C# Pin
misterbear17-Jan-04 23:52
misterbear17-Jan-04 23:52 

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.