Hey guys, I was just wondering what the term wildcard means in C++ and I was also wondering why some people initalize int variables to -1 rather than 0 does this have any advantages?
Thanks in advance.
Hey guys, I was just wondering what the term wildcard means in C++ and I was also wondering why some people initalize int variables to -1 rather than 0 does this have any advantages?
Thanks in advance.
>I was just wondering what the term wildcard means in C++
It means nothing in C++.
>why some people initalize int variables to -1 rather than 0 does this have any advantages?
Not really, but it very much depends on the rest of the code. Can you give an example?
ive used -1 for when i do a queue.
ill start the first element at 0 and the back of it at -1 then step them through. either that or start one of them at whatever i define max with.
i think ive used -1 with stacks as well.
its just a personal style usually about where you start your variables at.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.