"C++ memset()"의 두 판 사이의 차이

(새 문서: ==개요== ;C++memset() <syntaxhighlight lang='cpp' run> #include <iostream> #include <cstring> using namespace std; int main() { char str[] = "hello world"; memset(str, '*'...)
 
10번째 줄: 10번째 줄:
     char str[] = "hello world";
     char str[] = "hello world";
     memset(str, '*', 5);
     memset(str, '*', 5);
     cout << str;
     cout << str; // ***** world
}
}
</syntaxhighlight>
</syntaxhighlight>

2024년 1월 2일 (화) 14:00 판

1 개요

C++memset()
#include <iostream>
#include <cstring>
using namespace std;

int main() {
    char str[] = "hello world";
    memset(str, '*', 5);
    cout << str; // ***** world
}

2 같이 보기

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}