Hey everyone, I have a problem. My program needs to import an array of timestamps in the form 0:00:00 from a data file and extract the hour, the minute, and second of each. Because there are ":", I imported the timestamps as strings (variable declaration is: std::string timestamp[100]). Each individual timestamp prints to the screen as strings. Now to extract each item, my thought process was to use strcpy to copy the contents of each timestamp to a character array. However, after having no luck with that, I used "timestamp[0].length()" to find the length of the string and it returned 0. Why is it doing that? If it would return "7" then the strcpy would work and i would be able to extract it. Any ideas of what is going on would be greatly appreciated.
Note: In my code below, I just tested the first string element of timestamp[100] to see if it can be copied to an accessible character array.