You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am very glad to see this library and thanks for ur effort .I will make my problem short:
if I have a json like:
{
"SentenceStressScore": 54,
"WordsStressScore": 54,
"consonant_score": 54,
"words_info": [{
"score": 50,
"word": "HOW"
}, {
"score": 50,
"word": "ARE"
}, {
"score": 50,
"word": "YOU"
}]
}
and I want to use struct to get it,here is my code:
`#include
#include
#include
#include "json.hpp"
main.cpp: In function ‘void to_json(json&, gop&)’:
main.cpp:35:94: error: no matching function for call to ‘nlohmann::basic_json<>::basic_json()’
{"pauseScore",g.pauseScore},{"sentence_score",g.sentence_score},{"words_info",g.words_info}}
I am very glad to see this library and thanks for ur effort .I will make my problem short:
if I have a json like:
{
"SentenceStressScore": 54,
"WordsStressScore": 54,
"consonant_score": 54,
"words_info": [{
"score": 50,
"word": "HOW"
}, {
"score": 50,
"word": "ARE"
}, {
"score": 50,
"word": "YOU"
}]
}
and I want to use struct to get it,here is my code:
`#include
#include
#include
#include "json.hpp"
using json=nlohmann::json;
using namespace std;
struct words{
float score;
float word;
};
struct gop{
float SentenceStressScore;
float WordsStressScore;
float consonant_score;
vector words_info;
};
int main(){
string s2="{ "SentenceStressScore": 54,"WordsStressScore": 54,"consonant_score": 54, "words_info": [{"score": 50, "word": "HOW"}, {"score": 50, "word": "ARE" }, { "score": 50, "word": "YO"}]}";
}`
But this is wrong ,I can't find how to do it? help,pz,I appreciate.
The text was updated successfully, but these errors were encountered: