Home Forums Job & Work Life 프로그래밍 독학 중 질문 This topic has [7] replies, 0 voices, and was last updated 6 years ago by T. Now Editing “프로그래밍 독학 중 질문” Name * Password * Email Topic Title (Maximum Length 80) 이런 페이지가 나왔는데 인터넷으로 간단하게 설명된 동영상을 찾아보려고 합니다. symmetric, asymmetic 이해가 잘 안가는데 찾아보니 너무 광범위해서 .... 어떤 키워드로 찾아보면 될지 혹시 알 수 있을까요.... 감사합니다. Choose Loop Bounds That Match Your Task Suppose you want to print line numbers that go from 1 to 10. Of course, you will want to use a loop for (int i = 1; i <= 10; i++) The values for i are bounded by the relation 1 ≤ i ≤ 10. Because there are ≤ on both bounds, the bounds are called symmetric. When traversing the characters in a string, it is more natural to use the bounds for (int i = 0; i < str.length(); i++) In this loop, i traverses all valid positions in the string. You can access the ith character as str.substr(i, 1). The values for i are bounded by 0 ≤ i < str.length(), with a ≤ to the left and a < to the right. That is appropriate, because str.length() is not a valid position. Such bounds are called asymmetric. In this case, it is not a good idea to use symmetric bounds: for (int i = 0; i <= str.length() - 1; i++) // Use < instead The asymmetric form is easier to understand. I agree to the terms of service Update List