C how to insert string into array? : I want to insert string to the array until I type "ok". Why I am getting just "ok" and original array at the output?

int main(void)
{

    

	char b[20];
	char* str[10] = { "1","2" };
	int i = 2;
	while (1) {

		gets(b);
		if (strcmp(b, "ok") == 0) break;
		str[i] = b;
		i++;
	}

	for (int j = 0; j < i; j++)
		printf("%s ", str[j]);
	return 0;
}