
Stopwatch Class



using System.Reflection;
public partial class Form1 : Form
{
private Customer customerInEdit;
private System.Collections.ArrayList customers =
new System.Collections.ArrayList();
private Customer customerInEdit;
private int rowInEdit = -1;
private bool rowScopeCommit = true;
}
private void Form1_Load(object sender, EventArgs e)
{
this.dataGridView1.VirtualMode = true;
this.dataGridView1.CellValueNeeded += new
DataGridViewCellValueEventHandler(dataGridView1_CellValueNeeded);
}
private void dataGridView1_CellValuePushed(object sender,
System.Windows.Forms.DataGridViewCellValueEventArgs e)
{
Customer customerTmp = null;
if (e.RowIndex < this.customers.Count-1)
{
// If the user is editing a new row, create a new Customer object.
if (this.customerInEdit == null)
{
this.customerInEdit = new Customer(
((Customer)this.customers[e.RowIndex]).CompanyName,
((Customer)this.customers[e.RowIndex]).ContactName);
}
customerTmp = this.customerInEdit;
this.rowInEdit = e.RowIndex;
}
else
{
customerTmp = this.customerInEdit;
}
// Set the appropriate Customer property to the cell value entered.
String newValue = e.Value as String;
switch (this.dataGridView1.Columns[e.ColumnIndex].Name)
{
case "contactNameColumn0":
customerTmp.CompanyName = newValue;
break;
case "contactNameColumn1":
customerTmp.ContactName = newValue;
break;
}
}
副程式
int *Function(void)
{
int DataArray[10];
for( int i ; i = 0; i < 10; i++ )
DataArray[i] = i ;
return DataArray;
}
主程式
int main(void)
{
int *ReciveData;
ReciveData=Function();
return 0;
}