Fixes main() return should be int in new examples
This commit is contained in:
parent
3c8a923439
commit
75cee948d4
@ -22,11 +22,13 @@ struct MyHandler {
|
|||||||
bool EndArray(SizeType elementCount) { cout << "EndArray(" << elementCount << ")" << endl; return true; }
|
bool EndArray(SizeType elementCount) { cout << "EndArray(" << elementCount << ")" << endl; return true; }
|
||||||
};
|
};
|
||||||
|
|
||||||
void main() {
|
int main() {
|
||||||
const char json[] = " { \"hello\" : \"world\", \"t\" : true , \"f\" : false, \"n\": null, \"i\":123, \"pi\": 3.1416, \"a\":[1, 2, 3, 4] } ";
|
const char json[] = " { \"hello\" : \"world\", \"t\" : true , \"f\" : false, \"n\": null, \"i\":123, \"pi\": 3.1416, \"a\":[1, 2, 3, 4] } ";
|
||||||
|
|
||||||
MyHandler handler;
|
MyHandler handler;
|
||||||
Reader reader;
|
Reader reader;
|
||||||
StringStream ss(json);
|
StringStream ss(json);
|
||||||
reader.Parse(ss, handler);
|
reader.Parse(ss, handler);
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
using namespace rapidjson;
|
using namespace rapidjson;
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
void main() {
|
int main() {
|
||||||
StringBuffer s;
|
StringBuffer s;
|
||||||
Writer<StringBuffer> writer(s);
|
Writer<StringBuffer> writer(s);
|
||||||
|
|
||||||
@ -30,4 +30,6 @@ void main() {
|
|||||||
writer.EndObject();
|
writer.EndObject();
|
||||||
|
|
||||||
cout << s.GetString() << endl;
|
cout << s.GetString() << endl;
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user