create account

asprintf function by tychebe

View this thread on: hive.blogpeakd.comecency.com
· @tychebe ·
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");
👍  
properties (23)
authortychebe
permlinkasprintf-function
categorysecurity
json_metadata{"tags":["security","linux","asprintf","function","gnu"]}
created2016-09-24 07:59:36
last_update2016-09-24 07:59:36
depth0
children0
last_payout2016-10-25 07:59:42
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length511
author_reputation27,548,928,872
root_title"asprintf function"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,345,124
net_rshares53,981,556
author_curate_reward""
vote details (1)