Can't I send NULL as a parameter with a constructor?
Posted
by Jason94
on Stack Overflow
See other posts from Stack Overflow
or by Jason94
Published on 2010-05-19T09:36:53Z
Indexed on
2010/05/19
9:40 UTC
Read the original article
Hit count: 217
c++
Lets say i have a Shape object that has a constructor like this:
Shape( width, height, radius, depth )
Now, I just have a silly rect so i dont need redius and depth... is it okey to do
Shape myRect(50, 50, NULL, NULL) ?
I know its not the best idea and I should use inheritance and stuff but this is the mess im in so can i use NULL like this?
© Stack Overflow or respective owner