Hello,

I am using C memcached client in one of my applications. I am using 
different ASCII characters as a key for storing in memcached. However, when 
I retrieve data using memcached_get() it is always returning null.

I have attached the source file for reference.

Regards,
Junaid.

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"memcached" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <libmemcached/memcached.h>

int main() {
    const char* config_string = "--SERVER=127.0.0.1";
    memcached_st* memc = memcached(config_string, strlen(config_string));
    char key[]= "\x13\x05\x07\x03\x01";
    char* value = "Saved Value";
    size_t value_len = 100;
    uint32_t flags;
    memcached_set(memc, key, strlen(key), value, strlen(value), 6, 0);
    size_t return_value;
    memcached_return_t error;
    char* datavalue = memcached_get(memc, key, strlen(key), &return_value, &flags, &error);
    printf("len[%d] value[%s] error[%d]", return_value, datavalue, error);

    memcached_free(memc);
}

Reply via email to