substr2 substr ][ c++1z substr ][ c++1z 1.소스 #include #include using namespace std; void* operator new(size_t n) { cout 2016. 9. 20. substr substr( position, length ) : position으로 부터 lenght까지의 문자열 출력 1. test 소스 1 #include int main() { char string[1000] = {"black falcon"}; char sub[1000]; int position = 7; int length = 6; int c = 0; while( c < length ) { sub[c] = string[position+c-1]; c++; } sub[c] = '\0'; printf(" substring is %s\n", sub ); return 0; } 결과 hacker@HACKER:~/c$ gcc -o substr substr.c hacker@HACKER:~/c$ ./substr substrin.. 2016. 7. 12. 이전 1 다음