0

Here is the situation:
I have a class in which has a method in which I have a loop that overwrites a buffer with a new letter every iteration and the buffer's datatype is LPSTR.

My question is, how I could take all the letters that are generated in the loop and return them as a char array?

Forivin
  • 14,780
  • 27
  • 106
  • 199
  • LPSTR is a typedef for `char *`, so it must already be pointing into a char array. – M.M Apr 13 '14 at 02:25

1 Answers1

1

I hope I understood you correctly, but from what I read I gathered you're trying to do something like this:

char buffer[256];
for(int i = 0, char c; (c = someAction()) != NULL && i < 256; ++i) {
    buffer[i] = c;
}
Outsider
  • 550
  • 3
  • 9