코드컨벤션과 Git hub
배열과 리스트
int score1;
int score2;
int score3;
int score4;
int score5;
int score6;
int score7;
int score8;
int score9;
int score10;
// 위와 같이 쓸 경우 찾기도 어려움
// 수가 많아지면 모든 수에 대한 선언을 해야하는 문제 점이 있음
// 조건문을 넣기 위해서는 변수의 개수만큼 조건문도 필요함
int[] scores = new int [10];
// 위와 같이 표현하면 변수를 통일시키기 편함
// 풀어쓰게 되면 아래와 같이 변함
// scores[0] = 0;
// scores[1] = 0;
// scores[2] = 0;
// scores[3] = 0;
// scores[4] = 0;
// scores[5] = 0;
// scores[6] = 0;
// scores[7] = 0;
// scores[8] = 0;
// scores[9] = 0;
int input = 2;
int[] scores = new int[10]
scores[input]++;
// 배열의 크기가 달라져도 조건문이 변하지 않고 사용할 수 있음
List<int> scores = new List<int>();
// List는 <> 안에 자료형이 존재
int[] scores = new int[10];
// Array는 자료형이 밖에 존재
※ 단, C#에서의 List는 큰 Array
enum MyColor
{
Red,
Blue,
Green,
Yellow
}
// Red = 0, Blue = 1, Green = 2, Yellow = 3 로 값이 할당됨
enum MyColor
{
Red = 1,
Blue = 2,
Green = 4,
Yellow = 8
}
// 위와 같이 값을 할당하여 비트연산자 자리수 할당도 가능
배열과 리스트는 따로 공부를 하고 특강을 들어도 이해가 잘 되지 않고 있어서
이것이 C#이다 책과 해당 유튜브 강의로 복습 진행 중
'내일의 내가 오늘의 나보다 조금이라도 더 나아지길 바라며'