我想制作一个(nginx)v1
规则来过滤除了这些词之外的所有内容:key1
,another
,key2
,#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct time
{
int hour;
int minute;
char am_pm [3];
char (*standard_time)(struct time *self);
};
char standard_time_format(struct time *self)
{
char standard_format[8], conversion[3];
int length;
length = snprintf(NULL, 0, "%d", self->hour);
snprintf(conversion, length + 1, "%d", self->hour);
strcpy(standard_format, conversion);
strcat(standard_format, ":");
length = snprintf(NULL, 0, "%d", self->minute);
snprintf(conversion, length + 1, "%d", self->minute);
strcat(standard_format, conversion);
strcat(standard_format, self->am_pm);
return(standard_format);
}
int main()
{
struct time start;
char standard_format[8];
start.hour = 2;
start.minute = 34;
strcpy(start.am_pm, "am");
start.standard_time = standard_time_format;
strcpy(standard_format, start.standard_time(&start));
printf("%s\n", standard_format);
return 0;
}
即可。有谁知道如何表达?
答案 0 :(得分:1)
答案 1 :(得分:0)