Trad.cpp
上传用户:sz0451
上传日期:2022-07-29
资源大小:256k
文件大小:1k
- // This is the main project file for VC++ application project
- // generated using an Application Wizard.
- #include "stdafx.h"
- #using <mscorlib.dll>
- using namespace System;
- void func(int arr[], size_t size)
- {
- for(size_t i = 0; i < size; i++)
- Console::WriteLine(arr[i]);
- }
- // This is the entry point for this application
- #ifdef _UNICODE
- int wmain(void)
- #else
- int main(void)
- #endif
- {
- Console::WriteLine(S"Traditional Arrays");
- // Create an array
- int arr[10];
- // Fill the array
- for(int i = 0; i < 10; i++)
- arr[i] = i * 2;
- // Print its contents
- for(int j = 0; j < 10; j++)
- Console::WriteLine(arr[j]);
- func(arr, sizeof(arr)/sizeof(arr[0]));
- return 0;
- }