Is there any validation on character case as well in C++
Is number and NuMber identical
Collapse
X
-
Richa ChhabraTags: None -
-
It depends on what they are. For example, in this case they are indeed identical and interchangeable :
It depends on what you mean by identical. For example, in this case they are separate and distinct variables that happen to have the same [identical] value.Code:#define NumBer number
Please provide a little more background about your question.Code:int NumBer = 4; int number = 4;
To answer your inline question: neither C nor C++ validate names. You give a name and the compiler looks it up in an internal table. The lookup is case sensitive. The lookup either succeeds or fails; the compiler has no way to tell that you really meant to give a different name.
On the other hand, filenames might be case-insensitive depending on the operating system. In this case, the compiler doesn't look up the [file]name; instead it passes the filename to the operating system. It is the operating system that looks up the filename. DOS and Windows have case-insensitive filenames; UNIX has case-sensitive filenames.Comment
Comment