You can create an array of tuples using structs:
#include <stdio.h>
#include <string.h>
static struct { char strVal[21]; int intVal; } tuple[10];
static int tupleIndex = 0;
static void listTuples(void) {
("==========\nTuple count is %d\n", tupleIndex);
printffor (int i = 0; i < tupleIndex; ++i)
(" [%s] -> %d\n", tuple[i].strVal, tuple[i].intVal);
printf(;
puts}
static void addTuple(char *str, int val) {
("Adding '%s', mapped to %d\n", str, val);
printf(tuple[tupleIndex].strVal, str);
strcpy[tupleIndex++].intVal = val;
tuple}
static void deleteTuple(char *str) {
int tupleIndex = 0;
while (tupleIndex < tupleIndex) {
if (strcmp(str, tuple[tupleIndex].strVal) == 0) break;
++tupleIndex;
}
if (tupleIndex == tupleIndex) return;
("Deleting '%s', mapped to %d\n", str, tuple[tupleIndex].intVal);
printfif (tupleIndex != tupleIndex - 1) {
(tuple[tupleIndex].strVal, tuple[tupleIndex - 1].strVal);
strcpy[tupleIndex].intVal = tuple[tupleIndex - 1].intVal;
tuple}
--tupleIndex;
}
int main(void) {
();
listTuples
("aardvark", 31);
addTuple("buffalo", 41);
addTuple("camel", 59);
addTuple("dingo", 27);
addTuple();
listTuples
(;
deleteTuple();
listTuples
return 0;
}