일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |
Tags
- tff
- AXI4
- STM32
- Multiple transaction
- AXI3
- out-of-order
- ERROR RESPONSE
- APB3
- FGPA #반도체설계 #verilog #시프트레지스터 #uart
- Low-power Interface
- T flip flop
- 펌웨어
- ABMA
- FPGA
- 구조적모델링
- ordering model
- SoC
- 스텝모터
- atomic access
- 레지스터슬라이스
- AMBA
- stepmotor
- 카운터
- single copy atomic size
- Multiple outstanding
- QoS
- Verilog
- Interoperability
- cacheable
- 임베디드시스템
Archives
- Today
- Total
CHIP KIDD
[C#] 3. 배열기본 : 동적메모리할당 / 가변배열 본문
using System;
namespace Day01_03_배열
{
class Program
{
static void Main(string[] args)
{
// *** 동적 배열 *** --> 동적 메모리 할당
int size = int.Parse(Console.ReadLine());
int[] ary = new int[size];
// 10,20,30..... 까지 대입
for(int i=0; i< size; i++)
{
ary[i] = 10 * (i + 1);
}
// *** 가변 배열 *** --> 배열 크기가 수시로 변경
int[] numAry = { };
while(true)
{
Console.Write("숫자-->");
int num = int.Parse(Console.ReadLine());
if (num == 0)
break;
Array.Resize(ref numAry, numAry.Length + 1); //중요!
numAry[numAry.Length - 1] = num;
}
}
}
}
'전기전자 > C# 시각화프로그래밍' 카테고리의 다른 글
[C#] 6. 파일처리 바이너리파일 (0) | 2021.04.14 |
---|---|
[C#] 5. 파일처리(텍스트파일) (0) | 2021.04.14 |
[C#] 4. 2차원 배열 (0) | 2021.04.14 |
[C#] 2. 조건문 반복문 (0) | 2021.04.13 |
[C# ] 1. 기본문법 (0) | 2021.04.13 |