Professional Documents
Culture Documents
Email:-nabil299@gmail.com
pointers
Int *npntr
Double *ypntr ,*xpntr
cpntr Char
y Ypntr
Int y = 3
Int *ypntr
y Ypntr
int y
int ypntr
ypntr Int
y Ypntr
y address ypntr
Y
Y=3
Ypntr = 800
y
ypntr =y
y=3
ypntr = 5
y=5
Int *ypnt
ypntr =y
Pointer
Pointers
.Net C#
Compile C#
Pointers
Pointers
C++ C Pointers
C++ C
Garbage Collector Java
GC
Pointers
C++ C
C#
// NormalCopy.cs
using System;
Dst[i] = Src[i];
MySrcArray[i] = (byte) i;
CopyArray(MySrcArray, MyDstArray);
Console.Read();
byte Array
Loop
Pointers
Java GC C#
Pointers
Pointers
C++ C
Pointers
C#
C#
C# Pointers
C++ C
Libraries Java
.Net Infrastructure Classes
Pointers
unsafe C# Pointers
Code Reserved word or Keyword
Members Pointers
Constructors Functions Properties
Classes
{
...
unsafe
{
// Unsafe code to be here
}
...
}
// Using 'unsafe' in function declaration
unsafe void MyFunction()
{
// Do something
}
// Using 'unsafe' in class declaration
unsafe class MyClass
{
// Class body to be here
}
.Net unsafe
.Net
.Net unsafe Pointers
Pointers
C#
Pointer void *
type *
type
pMyByte = & MyByte; // pMyByte now points to MyByte (i.e. The value
// of pMyByte is the address of MyByte)
// Array of bool
bool [] MyBool = {true, false, false, true};
// pMyBool = MyBool // Error, arrays is also reference types
Console.WriteLine((pB + i)->ToString());
T T*
Pointer Types Object
Operator -> Operator
pMyByte->ToString()
Reference Types Arrays
GC
Pointers
Array NormalCopy.cs
MSDN
// FastCopy.cs
using System;
pD += 4;
pS += 4;
}
* pD = * pS;
pD++;
pS++;
}
}
}
}
MySrcArray[i] = (byte) i;
CopyArray(MySrcArray, MyDstArray);
Console.Read();
}
}
int * Pointer
Loop
Operand Right-Shift Operator >>
Count Operand
Loop
Operand Bitwise AND
Count Operand
Loop Loop
Array
Loop
Pointers
Pointers
Pointers MSDN
Pointers
C++ C C# Pointers
C# Pointers
Reference
c++
Reference
c++ Reference
#include<iostream.h>
include<conio.h>
void main()
{
Clrscr();
int x= 300;
int &ref=x;
cout<<"\ n x= "<<x;
cout<<"\ n p= "<<ref;
ref= 600;
cout<<"\ n x= "<<x;
cout<<"\ n p= "<<ref;
getch;
}