outputing a vector to screen?

Hello. I am currently trying to output text from a file and output it to the screen.. I am using a vector to store my strings.. I am wondering what functions I could use that would output the vector?

Currently the only function I know that outputs text to the screen is the TextOut() funcion. it uses LPCTSTR.

If there arnt any better functions how might I go about converting the vector to a LPCTSTR?
or maybe a function that dosn't require constant variables?
Last edited on

You can get a string from a vector of strings like this:

string someString = theVector[3]; // Get the 4th string

You can get a char* from a string like this:

char* p = someString.c_str();

You can (often) pass a char* to textout as the LPCTSTR parameter.
Last edited on
Concatenate all the strings in the vector into a single string, then use DrawText() to output it. Is that what you are looking for?
I need the strings to be seperate... each element in the vector represents a line in the text file.
I'm not saying you concatenate, then delete the vector. But you can concatenate and output using DrawText() and it will output all lines at once.
Topic archived. No new replies allowed.