Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

C 

Different compilers - different syntax?

(Mar 10, 2016 01:40 PM)ApexDexterity Wrote:  Ye apparently that's my problem. Thanks 😉

So as I said, I'm new to programming, but does setting the variable to 0 mean it's initialized? because I've tried setting it to everything (like 2, 20, 5000) and the code still runs.. So why set it to 0?

Local variables are allocated on this list referred to as a stack, when a variable is allocated you don't know what is at that location. Initializing it ensures that the coder knows the definition.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Python] by magicpartySep 1, 2019 04:59 AM 7 184 Sep 1, 2019 04:59 AM
Last Post: tux1
[Python] by F.A.S.TSep 15, 2017 02:22 PM 1 113 Sep 15, 2017 02:22 PM
Last Post: SIM-1866423
[C] by Burning tacoNov 19, 2014 01:14 PM 9 191 Nov 19, 2014 01:14 PM
Last Post: michaeljackson