I have a little problem, here is my code (I use C):
#include <stdio.h>
#include <curl/curl.h>
#include <stdlib.h>
#include <json/json.h>
size_t callback_func(void *ptr, size_t size, size_t count, void *stream) {
printf ("%s",(char*)ptr);
return count;
}
int main(void)
{
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "http://stream.twitter.com/1/statuses/filter.json?track=http");
curl_easy_setopt(curl, CURLOPT_USERPWD, "Firrus:password");
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, callback_func);
curl_easy_perform(curl);
curl_easy_cleanup(curl);
}
return 0;
}
The problem is that every time ptr is printed, the top three (seemingly random) characters are also displayed at the top, for example. 77D or 6DA. What do these symbols mean? How can I delete them?
user179169
source
share