A
Angus
Hello
result is a pointer so why is there no need to free allocated memory after
using strrchr?
Eg
#include <string.h>
#include <stdio.h>
char string[100] = "Find the last 'a' in this string", *result;
main()
{
/* Return a pointer to the last: 'a' */
result = strrchr(string, 'a');
printf("The remainder of the string starting at the first\n");
printf("'a' is: %s", result);
}
result is a pointer so why is there no need to free allocated memory after
using strrchr?
Eg
#include <string.h>
#include <stdio.h>
char string[100] = "Find the last 'a' in this string", *result;
main()
{
/* Return a pointer to the last: 'a' */
result = strrchr(string, 'a');
printf("The remainder of the string starting at the first\n");
printf("'a' is: %s", result);
}