Re: Pointers in C++

2018-01-08 Thread AudioGames . net Forum — Developers room : Kyleman123 via Audiogames-reflector


  


Re: Pointers in C++

Jonikster the reason you aren't understanding the many ways that you can use pointers is because you switch around and don't learn one tool. C++ is powerful. some of that is due to pointers. there are many ways to use pointers: dynamic memory allocation is just one of the many things as you mentioned. The more you use pointers and write code in c++ that uses pointers the more you will become comfortable understanding where they can be used Please pick a tool and stick with it. all the languages are going to be able to do what you always ask questions about. BGT does have it's limitations but I don't think you want to use it. even BGT could do most of the things you ask about satisfactorily. It all comes down to experience. Stick with a language and you will learn how to use it. switching back and forth helps no one, especially  not yourself.

URL: http://forum.audiogames.net/viewtopic.php?pid=346518#p346518





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Pointers in C++

2018-01-07 Thread AudioGames . net Forum — Developers room : chpross via Audiogames-reflector


  


Re: Pointers in C++

Hello,I agree with visualstudio, use smartpointers, this pointers will delete the conten or the pointed-object when you are outsite the block. This is recommented, because when a exception is thrown, it clean automaticly up the pointers. Also the smartpointers throw a exception when you try to access on a nullptr.Btw. use nullptr, not NULL. Because Null is defined as follows:#define NULL 0This macro can cause problems, when you have overloaded functions or something else.Use google to read more about smartpointers and which do you should use.best regards,Christopher

URL: http://forum.audiogames.net/viewtopic.php?pid=346424#p346424





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Pointers in C++

2018-01-07 Thread AudioGames . net Forum — Developers room : visualstudio via Audiogames-reflector


  


Re: Pointers in C++

hello again,i recommend you to use smart pointers (they use rII to new and/or delete the pointers and you wont get memory leek)

URL: http://forum.audiogames.net/viewtopic.php?pid=346416#p346416





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Pointers in C++

2018-01-07 Thread AudioGames . net Forum — Developers room : Hrvoje via Audiogames-reflector


  


Re: Pointers in C++

I was reading a book for C++ today, and some of the important rules when dealing with pointers are:1. When using new keyword, also always use delete, in case when you no longer need that pointer to prevent memory leaks.2. After using delete, also reset that pointer to null, in order to prevent crashing if you accidentally recall the deleted pointer somewhere in the code.4. Always check if pointer is null or not null before trying to recall it.5. The keyword delete *must* always be used also when you want to reinitialize pointer, in other words, when you wanna make it point to another variable.

URL: http://forum.audiogames.net/viewtopic.php?pid=346371#p346371





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Pointers in C++

2018-01-07 Thread AudioGames . net Forum — Developers room : visualstudio via Audiogames-reflector


  


Re: Pointers in C++

read about heep and stackwhen you declare a variable, it will be allocated on the stack while pointers are allocated into heepyou can manage memory with it (allocate and free when it is needed) hence faster speed and lower memory usagein OS development, it is needed for working with devices etcnd many many more!

URL: http://forum.audiogames.net/viewtopic.php?pid=346346#p346346





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector