日期:2014-05-17 浏览次数:20848 次
using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace SmartDeviceProject2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
unsafe
{
int i = 0;
int j = 0
MessageBox.Show("sdfsfsfsdfsdfsdfs");
int* p = stackalloc int[1222];
MessageBox.Show("sdfsfsfsdfsdfsdfs");
}
}
}
}
// compile with: /unsafe
class UnsafeTest
{
// Unsafe method: takes pointer to int:
unsafe static void SquarePtrParam(int* p)
{
*p *= *p;
}
unsafe static void Main()
{
int i = 5;
// Unsafe method: uses address-of operator&nb