I am using GetWindowText to take user entered data, then seperate it out into variables, then finally use the one variable I need. .The only problem is that when debugging, I am seeing 2:00 pm listed as "2:00 pm", '\0' <repeats 17 times> it should just be 2:00 pm or what the user entered. How do i get rid of this extra data?
#define GETITEM(item) GetDlgItem(hWndDlg, item)
char ConvertTime[10] = "";
char Hour[3] = "", Min[3] = "", AMPM[3] = "";
GetWindowText(GETITEM(IDC_CONVERT_TIME), ConvertTime, 8);
strncpy(Hour, ConvertTime, 2);
strncpy(Min, ConvertTime + 3, 2);
strncpy(AMPM, ConvertTime + 6, 2);