-
- In addition to macro substitution,
- When a line starting with
# ~~~
is encountered, it does various things-
#include: Searches for a file from the relative path to the file being analyzed or from the include path, and expands it on that line.
- Is it really just copying the entire contents?
-
-
The#include directive has two ways to specify the file name: using "" and using <>. Each has different behaviors.
- The latter goes only to the include path
- Are there std something in the include directory?
- The latter goes only to the include path
- Uses of macros
- include guard
- Since INCLUDE_GUARD is already defined from the second time onwards, is the code ignored when it is expanded in pre-processing?
- include guard
-
Pointers c
char a = 'a'
char* b = &a
char c = *b // The value of 'a' that the pointer b points to is assigned to c
- > In other words, the notation char* b is equivalent to char *b. In this case, you can also see that "the type of b is char*" in addition to "the type of *b is char".
- I see~(blu3mo)
- Why `char** argv`?
- Variables of arrays hold the pointer to the first element
- So the type of the variable of char array becomes `char*`
- Is the pointer to that "array" `char**`?
- Don't know the strings of each element in argv
- So, when reading, read until the end literal `\0` comes
-
using namespace std is used to avoid conflicts with other namespaces for std
- An error occurs if there is a conflict
- Is this only for C++?
-
- Both unsigned and signed consume the same amount of memory
- You can indicate the type by adding a suffix after the value
-
-
The ’\0’ added at the end is the null character. In C and C++, strings are often assumed to be null-terminated, so an additional character is added for null termination. It’s a historical reason.
-