Originally Posted by
whiteflags
memcpy is the function you'd want to use if you want to avoid writing a loop, but it may be more complicated than just one function call. It depends on the specifics of the char info type.
The CHAR_INFO type is a standard Windows type defined in the include:
Code:
typedef struct _CHAR_INFO { // chi
union { /* Unicode or ANSI character */
WCHAR UnicodeChar;
CHAR AsciiChar;
} Char;
WORD Attributes; // text and background colors
} CHAR_INFO, *PCHAR_INFO;
And well, the memcpy() works just fine, I tried it and it works.
I need to perform another operation on the structure, I need to
access the single bytes one at a time. Can I do it using a pointer?
Something like:
Code:
char *ptr_starget = &starget[0];
char *ptr_array = &array[0];
for (x = 0; x <= 7999; x++)
*ptr_starget++ = *ptr_array++;