Reproduced in: http://www.itxuexiwang.com/a/shujukujishu/redis/2016/0216/143.html
The various operational commands, operating mechanisms, and server initialization parameter configurations of Redis have been described in great detail in previous blogs. This blog is the last of a series of blogs that will give you code examples for accessing and manipulating Redis servers based on the Redis client component. It should be explained, however, that since Redis does not officially provide a Windows platform client based on C interfaces, the following example can only be run on the Linux/unix platform. However, for developers using other programming languages, such as C # and Java,redis, which provide client components for these languages, it is also possible to achieve various interactions based on the Windows platform and the Redis server.
The client used in this blog is from the Redis official website and is the Redis-recommended C-interface-based client component, as shown in the following link:
Https://github.com/antirez/hiredis
In the following code example, two of the most commonly used REDIS command operations are given, both in normal invocation and pipeline-based invocation mode.
Note: Please note the comments when reading the code.
#include <stdio.h> #include <stdlib.h> #include <stddef.h> #include <stdarg.h> #include < string.h> #include <assert.h> #include Redis Tutorial (15): C Language Connection Operation code instance