How would i output my vector of strings into a ".txt" file?
The same way you would write any character array. If you don't know how to do that either here is a tutorial to help you out.
This post should help
You have to iterate through the elements of the vector and output each string to the file.
Here's one way:
for(const auto& s : v)
file_out << s << std::endl;
for(auto it = v.begin(); it != v.end(); ++it)
file_out << *it << std::endl;
for(std::size_t i = 0; i < v.size(); ++i)
file_out << v[i] << std::endl;
There's really not much to it. Pick what you are most comfortable with.
Good day to everyone.
I need help. Have to make more of these and need someone to show me how.
My code doesn't work the way it should.
It would ...
Why doesn't the code (2) below produce the same output as the code (1)? Let's say you entered "4" as input:
cout << "enter integer: ";
I am using following codes on EVERY textbox.
private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
char ch = e.KeyChar;
if (ch == (char)Keys.Back)
e.Handled = ...