본문 바로가기

전체 글

10 Array, Pointer 10-01. 배열과 메모리 자료형의 크기만큼 메모리가 계산된다! 10-02. 배열의 기본적인 사용방법 #define MONTHS 12 //symbolic constant, macro int main() { int high[MONTHS] = {2,5,11,18,23,27,29,30,26,20,12,4}; // Address printf("%p %p \n", high, &high[0]); for (int i =0; i < MONTHS; ++i) printf("%lld \n", (long long)&high[i]); // 10진수로 출력하여 4씩 증가하는지 확인(int이므로) printf("\n"); ///* complier doesn&#39;t check whether indices are valid!! *.. 더보기
12 Orthogonal Projections Projections onto subspaces Then we can say that like this. We already have seen that vector x in R can be represented by a vector in V and a vector in complement orthogonal. Visualizing a projection onto a plane The projection of x onto L, x - $proj_L x$ is orthogonal to L!! Projection is closted vector in subspace Projection of x onto v is the closest vector in our subspace to x. It's closer th.. 더보기
11 Orthogonal complements 11. Orthogonal complementsOrthogonal complementsV perp is equal, to the set of all x's, all the vectors x that are a member of our $R^n$, such that x dot V is equal to zero for every vector V that is a member of our subspace.Then what does this imply?What is a fact that a and b are members of V prep?√ That means a dot V, where this V is any member of our original subspace is V, is equal to 0 for.. 더보기
10 Transpose of a matrix Transpose of a matrix Let's define a transpose matrix. Transpose of a transpose matrix A is same with the matrix A! Determinant of transpose Let's assume determinant of any nxn matrix B is equal to the determinant of B's transpose. Then will it be the same if the matrix is (n+1) x (n+1)? Transpose of sums and inverses ) This means that C transpose is equal to the transpose of (A+B)! Rank(a) = ra.. 더보기
20220331 방향을 바꾼 후의 상황 보호되어 있는 글입니다. 더보기
09 function, pointer 09-01. 함수가 필요할 때 왜 함수가 필요한지, 어떤 경우에 함수가 필요한지부터 알아보자. 함수를 사용하지 않던 코드들을 함수를 사용하여 동작하도록 하는 것을 re-factoring이라고 한다. #define _CRT_NOSECURE_NO_WARNINGS #include #include // strlen() #include #define WIDTH 40 #define NAME "ChangHyun Oh" #define ADDRESS "CA, USA" void print_chars(char c, int n_stars, bool endl) { for (int i =0; i < n_stars; ++i) printf("%c",c); if (endl == true) printf("\n"); } void prin.. 더보기
08 Input Output 08-01. 입출력 버퍼 버퍼란 입력을 받거나 출력을 할때, 한꺼번에 모아서 입출력을 하여 효율성을 높게 해준다. 전반적으로 다양한 경우에서 사용된다. 보면, 우리는 hello를 입력했고 한 글자씩 입출력이 되는 것을 예상할 것이다. 하지만 실제 실행결과를 보면, hello 전체를 입력, 출력함을 알 수 있을 것이다. 08-02. End Of File(EOF) ASCII code는 양수밖에 없다. 하지만 왜 unsigned int가 아니라 int로 변수를 선언해 입력을 받을까? 이유는 EOF 때문이다! EOF는 -1로 define되어 있다! int main() { int c; while((c = getchar()) != EOF) //End Of File putchar(c); } 또 하나 중요한 개념이 있.. 더보기
07 If문 07-01. if #define _CRT_SECURE_NO_WARNINGS #include int main() { int number; printf("input a positive integer : "); scanf("%d", &number); // Todo: print even or odd if (number % 2 ==0) printf("Even"); else if (number % 2 != 0) printf("ODD"); return 0; } 07-02. getchar(), putchar() example char을 입력받아서 출력하기 int main() { /* 1. Introduc getchar(), putchar() 2. Use while loop to process char sequences.. 더보기