Arg, ok, I'm reading in lines from a file. I'm then searching for a substring in the line I read in. If it's present, I then search for a particular character ('[') using strchr. Now, how would I go about extracting the 11 characters after the '[' into a new string? I just can't get it to work. I've tried something like this.
char line[200];
// stuff to get line
char * position;
int index;
position = strchr(line, '[');
index = -(line - position);
char date[11];
for (int i = 1; i <= 11; i++)
strcat(date, line[index+i]);
However, I get an error about converting char to const char*. I realize these are the parameters of strcat, but I can't think of how to do this otherwise. I can't make line a const char* because I have to keep reading into it and changing its contents.