Added a function to get a range of characters from the TString object.
This commit is contained in:
@@ -78,6 +78,28 @@ int main(int argc, char** argv) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (input[0] == 'g') {
|
||||
if (input[1] != '\0') {
|
||||
printf("Select index: ");
|
||||
fgets(input, sizeof input, stdin);
|
||||
|
||||
int num = strtol(input, NULL, 10);
|
||||
printf("Enter count: ");
|
||||
|
||||
fgets(input, sizeof input, stdin);
|
||||
|
||||
int count = strtol(input, NULL, 10);
|
||||
|
||||
char* text = TStringGetStringRange(num, count, string);
|
||||
|
||||
printf("Returned String:\n'%s'\n", text);
|
||||
|
||||
free(text);
|
||||
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
TStringAppendText(input, string);
|
||||
}
|
||||
//fgets(glyph, 10, stdin);
|
||||
|
||||
Reference in New Issue
Block a user