我有一个这样的输入json:
输入:
#include<stdio.h>
#include<ctype.h>
#define MAX_SIZE 100
int main(){
int i;
char c[MAX_SIZE]={0};
printf("Enter message:");
for(i=0;getchar()!='\n';i++){
c[i] = getchar(); /*looks like some error here that the compiler didn't found out.....*/
}
for(i=0;c[i]!='\n';i++){
putchar(c[i]);
}
return 0;
}
在这里,我需要更改密钥-authtype并将这些值放入数组中。
期望的杰森:
{
"userstatus": {
"authtype": "S,R,T",
}
}
但是我的实际输出是这样的:
{
"userstatus": {
"authtype": ["S","R","T"]
}
}
JOLT SPEC:
{
"authtype" : [ "S,R,T" ]
}
请为上述测试用例提供帮助吗?
答案 0 :(得分:0)
这是您的规格。您应该在修改操作中使用分割功能。
int lifePoints = 100;
// not a full code but just giving an explanation
if (player == ("attackthem!"))
{
change integer value here. how?
}