asprintf function
□ allocated string printf
□ It is function of GNU extensions(No C or POSIX)
□ int asprintf(char **strp, const char *fmt, ...)
□ It prints the contents of fmt to the strp. As much as the fmt+null's size, a memory is allocated to the strp. Later additionally, memory release is needed.
□ When successful, it returns the number of characters printed. When an error occurs, It returns -1.
□ Example : This stores the string "This sis infosec" in the buffer
char *buffer;
asprintf(&buffer, "This is %s", "INFOSEC");