user1664625
user1664625

Reputation:

outputing a vector to screen?

Hello this is my first question . 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?

Upvotes: 1

Views: 144

Answers (1)

NullPoiиteя
NullPoiиteя

Reputation: 57322

after the @john suggestion

to get a string from a vector of strings like below:

string someString = theVector[0];  //get the first string 

to get a char* from a string like below:

const  char* p = someString.c_str();

you can pass a char* to TextOutA as the LPCTSTR parameter.

Upvotes: 3

Related Questions