If you look at the std::string constructors, you will see that there's no constructor that just takes the size. The closest is what you're already using, the "fill constructor". http://www.cplusplus.com/reference/string/string/string/
If you don't want to fill the string with data, you could create then resize it.
1 2 3
std::string s;
s.resize(k);
Just an idea, perhaps you should look into std::vector if your strings are used to hold non-text data.
If you want strings with a precise size, you are then looking for C-Style strings.
Here is how to use them:
char s[25]; //Declare a string (a char array actually) of size 25.
Just an example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
//C-Style string example
#include <iostream>
usingnamespace std;
int main()
{
char name[15]; //Declare a char array (C-String) of size 15
cout << "Please enter your name: ";
cin >> name; //Use it like a normal string.
cout << "Hello " << name << "!" << endl; //Can print it too.
return 0;
}