ArrayList ImportantData = new ArrayList();
为何编译时,通不过??
--------------------Configuration: InspectCar - Win32 Debug--------------------
Compiling...
InspectCarDlg.cpp
D:\Inspect\Inspect.cpp(466) : error C2065: 'ArrayList' : undeclared identifier
......InspectCar.exe - 102 error(s), 0 warning(s)缺少头文件吗?
为何编译时,通不过??
--------------------Configuration: InspectCar - Win32 Debug--------------------
Compiling...
InspectCarDlg.cpp
D:\Inspect\Inspect.cpp(466) : error C2065: 'ArrayList' : undeclared identifier
......InspectCar.exe - 102 error(s), 0 warning(s)缺少头文件吗?
解决方案 »
- MFC里的DoDataExchange函数的一些问题
- 怎样检测网络连接中数据传输速度
- 急,求助!在线等!使用完成端口,WSARecv收到的数据永远都是固定长度?
- 如何在控件中编写对外接口?十万火急!先谢谢了
- 有用过shockwaveflash组件的吗? 问个问题
- 程序中怎麼引用沒有給lib文件的dll 中的api 函數(只有一個dll文件和dll里面函數說明的文件)謝謝!!
- 求助!能不能在CComboBox中添加线型??
- vc6在server 2003中使用时,点击菜单就出错退出,怎么解决??
- 如何使程序自动修改CEdit中的文字?
- 如何在dialog上作一个随鼠标动得字符串?(内无)
- 如何让程序在后台运行,并且抓取后台运行的程序的屏幕
- 如何在VB或其他脚本语言中获取或设置一个SAFEARRAY值?
Namespace: System.CollectionsAssembly: mscorlib.dll
[C#]
using System;
using System.Collections;
public class SamplesArrayList { public static void Main() { // Create and initialize a new ArrayList.
ArrayList myAL = new ArrayList();
myAL.Add("Hello");
myAL.Add("World");
myAL.Add("!"); // Display the properties and values of the ArrayList.
Console.WriteLine( "myAL" );
Console.WriteLine( "\tCount: {0}", myAL.Count );
Console.WriteLine( "\tCapacity: {0}", myAL.Capacity );
Console.Write( "\tValues:" );
PrintValues( myAL );
} public static void PrintValues( IEnumerable myList ) {
System.Collections.IEnumerator myEnumerator = myList.GetEnumerator();
while ( myEnumerator.MoveNext() )
Console.Write( "\t{0}", myEnumerator.Current );
Console.WriteLine();
}
}myAL
Count: 3
Capacity: 16
Values: Hello World !