Hello, I need to get data from the clipboard as a string, so that I can traverse the string and do work on possibly each character of the string.
Here is the code I have:
The problem is, when I later try to access the character at str[0], the program crashes.Code:int main() { OpenClipboard(NULL); char *str; HANDLE hData; hData = GetClipboardData(CF_TEXT); str = (char*)GlobalLock(hData); CloseClipboard(); }
Thanks for your help.