반응형

전체 글 287

0317_ 인벤토리_개체 참조가 개체의 인스턴스로 설정되지 않았습니다.

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace study05_HW { public class Inventory { public int capacity; public Item[] items; public int index; public Inventory(int capacity) { this.capacity = capacity; this.items = new Item[this.capacity]; } public void Additem(Item item) { this.items[this.index] = item; Console.Wri..

C#/문제해결 2021.03.18

0317_인벤토리만들기, 인덱스가 배열 범위를 벗어났습니다.

new Inventory(3); 를 넣었지만, public Inventory(int capacity){ this.items = new Item[this.capacity]; } 에 this.capacity = capacity; 가 빠져서, 커퍼시티 변수가 맴버변수에 들어가지 않아서 인덱스 값이 생성되지 않아서 생긴 오류 였습니다. public Inventory(int capacity){ this.capacity = capacity; this.items = new Item[this.capacity]; } 으로 수정하였습니다.

C#/문제해결 2021.03.18

Oculus Quest 2 // skt 구매

Oculus Quest 2 가 발매 된지 꽤 됐죠?? Oculus사에서 정식 발매를 하지 않아서. 직구로 구하는게 대부분 이었는데요. 최근에 SKT에서 Oculus Quest2 에 한해서 정식으로 발매를 하여서 꽤 이슈가 되었죠 ㅎㅎ 2차는 저도 아쉽게 못 구했는데요. 3차 때는 알람 문자를 받고 구매하였습니다 ! (벌써 3차 완판이라니 많은 사람들이 VR 세상에 들어오고 계시나 봅니다 ㅋㅋ) SKT에서 구매를 하면 1년 무상 A/S 까지 지원을 해준다고 하니 아주 큰 이점이라고 생각듭니다! 공식 판매가 414,000원 (64G) 으로 가격도 타 HMD(Head Mounted Display)에 비하면 저렴한 편이네요. 대신 해상도나 주사율, 트래킹(별도 모듈이 없음)이 부족한 단점이 있습니다. 하지만, ..

0317 _ 문) 클래스를 만들어서 배열 만들기

Array //Item 배열 변수 선언 Item[] items; //Item 배열 인스턴스 및 변수에 할당 items = new Item[3]; //Item 배열의 요소에 값 할당 Item item1 = new Item(100, "장검"); Item item2 = new Item(101, "단검"); items[0] = item1; items[1] = item2; //Item 배열의 길이 출력 Console.WriteLine("item 배열의 길이 : {0}", items.Length); //Item 특정 요소 값 배출 Item exportitem = items[0]; Console.WriteLine(exportitem.GetName()); //for문과 foreach문을 사용해 Item 배열의 요소 출..

C#/C#언어 2021.03.17

0317 _ 문제1) 배열 복습 연습문제

Array //string 배열 변수 string[] strarr; //string 배열 인스턴스 및 변수에 할당 strarr = new string[] { "수원시", "안양시", "인천광역시" }; //string 배열의 요소에 값 할당 // string 배열의 요소 값 출력 (index : 0 ~ n-1) Console.WriteLine(strarr[0]); // 배열의 총 길이 Console.WriteLine("배열의 총 길이 : {0}", strarr.Length); //string Console.WriteLine("*************************************"); for (int i = 0; i < strarr.Length; i++) { Console.WriteLine(..

C#/C#언어 2021.03.17
반응형