Desc :

char* strnset( char* sting, int c, unsigned int count );

string - 채울 버퍼

c - 채울 문자

count - 채울 문자의 수

 

입력한 문자열의 첫번째 문자부터 count까지 문자를 c로 채운다


Source Code :

#include <stdio.h>
#include <string.h>

void main()
{
	char string[100];

	puts("문자열을 입력한 후 Enter키를 치세요!");
	puts("아무 문자도 입력하지 않으면 프로그램은 종료됩니다!");

	do
	{
		gets(string);

		if (strlen(string) == 0) break;

		strnset(string, '*', 5);
		puts(string);
	} while (1);
}

 


Result :

+ Recent posts