Re: Deserialize JSON to C++ vector
I am terribly sorry for the ignorance I have shown in my previous posts. I was very scared that I won't manage to finish the project, after rushing through it (I have hard-coded all the locations) I began studying C++ more indepth, because it's better
Re: Deserialize JSON to C++ vector
@camlorn, I see. Still, it has been interesting and fun in places to work without all the things that you would normally expect from a language. I enjoy it, even though it makes me pull out my hair time to time.
URL: https://forum.audiogames.net/post
Re: Deserialize JSON to C++ vector
@camlorn, I see. Still, it has been interesting and fun and places to work without all the things that you would normally expect from a language. I enjoy it, even though it makes me pull out my hair time to time.
URL: https://forum.audiogames.net/post
Re: Deserialize JSON to C++ vector
I guess you are right
URL: https://forum.audiogames.net/post/529645/#p529645
--
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: Deserialize JSON to C++ vector
You need to fully read a book and/or tutorial on C++ so that you know that, not try to shortcut it by getting the bare minimum from audiogames.net in the hope that it will somehow be enough.
URL: https://forum.audiogames.net/post/529616/#p529616
Re: Deserialize JSON to C++ vector
Camlorn, believe me, I am searching in Google but I dont know the names of the problems I need to solve.
URL: https://forum.audiogames.net/post/529586/#p529586
--
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https
Re: Deserialize JSON to C++ vector
Thank you for the website Americranian. I will see it.
URL: https://forum.audiogames.net/post/529585/#p529585
--
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman
Re: Deserialize JSON to C++ vector
@27You can't find the equivalent for C because you already know at least 90% of C because C is a tiny, tiny language and there's just not that much to say. Believe it or not.C feels like more because getting anything done in C at all takes 10 times
Re: Deserialize JSON to C++ vector
Look at this website. It literally has everything you need to know. www.learncpp.com If I can find the equivalent for C, that would be great.
URL: https://forum.audiogames.net/post/529577/#p529577
--
Audiogames-reflector mailing list
Audiogames
Re: Deserialize JSON to C++ vector
Look at this website. It literally has everything you need to know. www.learncpp.com
URL: https://forum.audiogames.net/post/529577/#p529577
--
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin
Re: Deserialize JSON to C++ vector
If you need to pass it by reference you can't and will need to create a variable, then pass a pointer. If you just want to pass it by value, myFunction(MyClass()) is what you want.There is a new keyword but it returns a pointer and you have to store
Re: Deserialize JSON to C++ vector
How can I pass a newly created object to the function in C++? I mean, to initialize the object with its corruction inline of the function, in C# its something like MyFunction(new MyClass(property1, Property2));
URL: https://forum.audiogames.net/post
Re: Deserialize JSON to C++ vector
The difference is that cout is an overnegineered mess. There are good reasons to use C++ iostreams from time to time, but in general I attempt to avoid it and it's definitely overkill for printing out some debug info.Also, yes, it does have format
Re: Deserialize JSON to C++ vector
I believe cout is C++ specific. Printf also uses modifiers for formatting whereas cout doesn’t. At least, not in the examples that I have seen.
URL: https://forum.audiogames.net/post/529286/#p529286
--
Audiogames-reflector mailing list
Audiogames
Re: Deserialize JSON to C++ vector
BTW what's the difference between printf and std::cout? I mean a noticeable difference
URL: https://forum.audiogames.net/post/529277/#p529277
--
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin
Re: Deserialize JSON to C++ vector
Actually, one small tip. You can just stick printf everywhere and see which printf ran last, that can sometimes do the trick.
URL: https://forum.audiogames.net/post/529272/#p529272
--
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin
Re: Deserialize JSON to C++ vector
OK... , I will research
URL: https://forum.audiogames.net/post/529271/#p529271
--
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: Deserialize JSON to C++ vector
I don't know. I use VSCode. Compile in WSL (if you can) and then you can do gdb which is entirely command line and for which you can get many tutorials via Google. But if this isn't console that's probably a nonstarter and you'll need to figure out how
Re: Deserialize JSON to C++ vector
So where I can find a guide how to debug with VS? I use the version 2019.
URL: https://forum.audiogames.net/post/529266/#p529266
--
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi
Re: Deserialize JSON to C++ vector
I'm not going to debug your whole project. You want to figure out how to use VSCode or GDB on it and find out what went wrong.
URL: https://forum.audiogames.net/post/529263/#p529263
--
Audiogames-reflector mailing list
Audiogames-reflector
Re: Deserialize JSON to C++ vector
Ok that one's fixed, but I have another porblem which is hard to debug. The program launches just OK, but when I enter a player's name, it exits without warning.The project can be found here. I share it so you can tell me what I did wronghttps
Re: Deserialize JSON to C++ vector
So, dumb question time. Why does changing to integer works when I compile? What does using enum name offer you that integer doesn’t?
URL: https://forum.audiogames.net/post/529244/#p529244
--
Audiogames-reflector mailing list
Audiogames-reflector
Re: Deserialize JSON to C++ vector
That kind of enum is unscoped, meaning that you just refer to them as up and down without a prefix.Using the name of the enum as the type in the function is correct and shouldn't be changed to int.Also you will notice that _d is not in fact defined
Re: Deserialize JSON to C++ vector
Change your declaration to int. Enums create integers. Also, adjust your case statements to look like so. int player::move_player(int move_by_value, int d){ switch (d)case up://...}
URL: https://forum.audiogames.net/post/529211/#p529211
Re: Deserialize JSON to C++ vector
Change your declaration to int. Enums create integers. Also, adjust your case statements to look like so. int player::move_player(int move_by_value, int d){ switch (d)case UP://...}
URL: https://forum.audiogames.net/post/529211/#p529211
Re: Deserialize JSON to C++ vector
Change your declaration to int. Enums create integers. Also, adjust your case statements to look like so. int player::move_player(int move_by_value, int d){ switch (d)case D_://...}
URL: https://forum.audiogames.net/post/529211/#p529211
Re: Deserialize JSON to C++ vector
Change your declaration to int. Enums create integers. int player::move_player(int move_by_value, int d){ //...}
URL: https://forum.audiogames.net/post/529211/#p529211
--
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin
Re: Deserialize JSON to C++ vector
Change your declaration to int. Enemies create integers. int player::move_player(int move_by_value, int d){//...}
URL: https://forum.audiogames.net/post/529211/#p529211
--
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin
Re: Deserialize JSON to C++ vector
WHy I have to be so fucking stupid? here's my problematic function:int player::move_player(int move_by_value, direction d){ switch (d) { case _d.up: player::player_position ++move_by_value; return player::player_position
Re: Deserialize JSON to C++ vector
It's probably fine.If it's not fine, you have a week, after which you will never see this code again. SO the proper question is is it fine for a week and then you will never see this code again. Only you can answer this question since only you
Re: Deserialize JSON to C++ vector
I dont have any specific issues. My help request iss more of the advice type, whether my approach is good
URL: https://forum.audiogames.net/post/528302/#p528302
--
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https
Re: Deserialize JSON to C++ vector
Your question cannot be answered with the information we currently have.You say that you need help, but you don't actually tell us your problem. We know about your player class, which is fine and all, but we don't know where you're running into issues
Re: Deserialize JSON to C++ vector
So yeah, I need some kind of help, or something, I guess.My game's gonna be a simple board game, so 1D only.I have created a class Tile, which has the propertiesstring Name, string Description, std::Vector Items.Then a level class, which originally
Re: Deserialize JSON to C++ vector
I mean, I get it. There's a reason I'm one of the most vocal don't use C++ voices around here despite using it myself.
URL: https://forum.audiogames.net/post/528244/#p528244
--
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin
Re: Deserialize JSON to C++ vector
I am sorry for my overall negativity here, but writing code for 3 other people and explaining it to them and writing it in the language you hate is not fun. I will just hardocde the game in the array.
URL: https://forum.audiogames.net/post/528239
Re: Deserialize JSON to C++ vector
If hardcoding is an option, it's probably best to do so. Most C++ serialization stuff will go through something like protocol buffers to avoid some of the "fun" here. That or you get one of the libraries where you register your data
Re: Deserialize JSON to C++ vector
Thank you both. Oh god, maybe I will just hardcode the thing and be done with it?
URL: https://forum.audiogames.net/post/528218/#p528218
--
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin
Re: Deserialize JSON to C++ vector
You go down this list, namely under the JSON heading, and pick one you like. Then you use it.JSON in C++ is difficult by the nature of C++, so don't expect this to be as easy as Python or anything like that. Because of the static types, you usually have
Re: Deserialize JSON to C++ vector
picojson
URL: https://forum.audiogames.net/post/528187/#p528187
--
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: Deserialize JSON to C++ vector
Oh, and if it will help someone help me, here's my JSON:{"levelName":"Mroczny Las","LevelAuthor":"Nuno","BackgroundMusic":"music.mp3","Ambience":"pao.wav","Tiles":[
Deserialize JSON to C++ vector
Hello,how can I deserialize my JSON file to a vector, array or some other kind of list? I need it for a school project so any help is greatly appreciated.I really tried to like C++, I really did, believe me haha.
URL: https://forum.audiogames.net/post/528118
41 matches
Mail list logo