For each of the below variable names, indicate (with y or n) whether it is legal and whether it uses the proper style. You may skip the style portion for any that are not legal. a. _isReady b. 3rdName c. num of wheels d. money#on#hand e. taxRate f. SeatNumber
@hartnn I would greatly appreciate your help!
variable names cannot start with a number or special character it should only start with an alphabet
Ok so a. n b. n c. y d. y e. y f. y
also there shouldn't be a space in between
also # is not allowed in the name
Oh. So a. n b. n c. n d. y, y e. y, y f. y, y
actually _ in the beginning is allowed! so 1st one is valid
Ok. But how do I know if they use the proper style?
and last 2 are valid, all others are invalid :)
How do I know if they use the proper style?
They want to know if they are legal and if they use the proper style
whats the proper style?
I have no idea. Maybe with the case?
i know about whether they are legal or not, i am not sure about styles.... try to dig it in your notes maybe?
Ok thanks. It doesn't say anywhere. It only talks about proper identifier syntax
http://www.c4learn.com/c-programming/c-variable-nameing-rules/ here they have explained in more clarity for the naming rules.. will search styles on internet
Thanks!
Join our real-time social learning platform and learn together with your friends!