Código:
Código C:Ver original
#include <stdio.h> #include <string.h> #include <malloc.h> /* ---------------------------------------------------------- */ char get_url() { char * url = ""; char * url1 = "http://api.duckduckgo.com/?q="; char searching[40]; char * url2 = "&format=xml\n"; asprintf(&url, "%s%s%s", url1, searching, url2); return *url; } int main() { char * result; *result = get_url(); return 0; }