Hello everyone,,
`int x = NULL`
Is this considered wrong or bad? and if so why?
I used to write 'using namespace std;' in my code because that's what most textbooks and classes did, but I found a nice post on a forum explaining why its bad and the reason for so. So it made me wonder if making a none pointer NULL was bad.
What if the int could be 0, or any other number? How could we check if a int was empty then?
`Object x = NULL;`
Is it okay to set objects equal to NULL, or should objects be initialized setting their data members to 0 or empty string, depending on their data types?
`int x = NULL`
Is this considered wrong or bad? and if so why?
I used to write 'using namespace std;' in my code because that's what most textbooks and classes did, but I found a nice post on a forum explaining why its bad and the reason for so. So it made me wonder if making a none pointer NULL was bad.
What if the int could be 0, or any other number? How could we check if a int was empty then?
`Object x = NULL;`
Is it okay to set objects equal to NULL, or should objects be initialized setting their data members to 0 or empty string, depending on their data types?
Comment