Is C++ case sensiteive?

Hello!
Please, is c++ case sensitive? Are there exceptions?
Many thnanks!!!

C++ is very case sensitive. A #include and #Include Are not the same thing. In fact, #Include does not exist at all. So whether you are creating your own function or using one from a library, check for case sensitivity.
Hello!
Many thanks for the anwer!!!
Reason for asing was creating stack:

#ifndef STACKSTR_H
#efine STACKSTR_H

...
#endif // STACKSTR

but THEN:

#incluce stackStr


That was the question!!!

MANY THANKS!!
A few typo's there, but pretty much everything is case-sensitive.

A couple of notes:
1. Generally preprocessor definitions/macros are all upper-case. That's only by convention.
2. Preprocessor commands (#ifndef, define, endif, include) are all lower-case.
3. When you #include a file, or open a file, the case-sensitivity depends on your OS. On windows, filenames are not case-sensitive, on linux, they are case-sensitive. I always match the proper case for my files to guarantee portability, even if I'm on windows.
Hello, Stewbond!
Does it mean, that I wrote in previous message can work in windows, but would not work in Linux?

To make it work in Linux, should I write :
#include<STACKSTR_H>

or:
#include<STACKSTR.H>

?

Many thans!!!
(p.s. I have usually windows!)
You should write the name of the file that you want to include.


#ifndef STACKSTR_H
#efine STACKSTR_H

...
#endif // STACKSTR_H
STACKSTR_H is just a name that you use for the include guard. You could use any name as long as it's unique.

With #include you specify the name of the file. The name that you used for the include guard in that file is not relevant.
Topic archived. No new replies allowed.