CoOrds
x;
y;
}
AccessMembers
{
Main()
{
CoOrds home;
{
CoOrds* p = &home;
p->x = 25;
p->y = 12;
System.Console.WriteLine(, p->x, p->y );
}
}
}
Pointers
{
Main()
{
* charPointer = [123];
( i = 65; i < 123; i++)
{
charPointer[i] = ()i;
}
System.Console.WriteLine();
( i = 65; i < 91; i++)
{
System.Console.Write(charPointer[i]);
}
System.Console.WriteLine();
System.Console.WriteLine();
( i = 97; i < 123; i++)
{
System.Console.Write(charPointer[i]);
}
}
}
TestCopy
{
Copy([] src, srcIndex, [] dst, dstIndex, count)
{
(src == || srcIndex < 0 ||
dst == || dstIndex < 0 || count < 0)
{
System.ArgumentException();
}
srcLen = src.Length;
dstLen = dst.Length;
(srcLen - srcIndex < count || dstLen - dstIndex < count)
{
System.ArgumentException();
}
(* pSrc = src, pDst = dst)
{
* ps = pSrc;
* pd = pDst;
( i = 0 ; i < count / 4 ; i++)
{
*((*)pd) = *((*)ps);
pd += 4;
ps += 4;
}
( i = 0; i < count % 4 ; i++)
{
*pd = *ps;
pd++;
ps++;
}
}
}
Main()
{
[] a = [100];
[] b = [100];
( i = 0; i < 100; ++i)
{
a[i] = ()i;
}
Copy(a, 0, b, 0, 100);
System.Console.WriteLine();
( i = 0; i < 10; ++i)
{
System.Console.Write(b[i] + );
}
System.Console.WriteLine();
}
}
- 上一頁:C# 圖片縮放放大剪切代碼
- 下一頁:Csharp: 請假輸入兩個日期:(只考慮最多相差一個月)對於不同月份的數據考慮月份數據分界
Copyright © 程式師世界 All Rights Reserved
|