C ++ related basics (reposted)

xiaoxiao2021-03-06  21

One. The following is a 32-bit C program under Windows NT, calculates the value of SizeOf char swar str [] = "Hello"; char * p = str; int N = 10; please calculate SIZEOF (STR) = 6 sizeof (p) = 4 SIZEOF (N) = 4 Void Func (CHAR STR [100]) {please calculate SIZEOF (STR) = 4} void * p = malloc (100); please calculate SIZEOF (P) = 4. Separation questions 1, what is IFNDEF / Define / Endif in the header file? Avoid repeating the same header file. 2, # include

What is the difference between #include "filename.h"? One looks a system library path. Another first find the user path and find the system path. 3, what is the use? (Please explain at least two) a statement as a function parameter to prevent parameters from being changed within the function. Another definition can be made as a global constant. Alternatively, such as #define xxx 22 forms. 4. Call the function after being compiled by the C program, why do you want to declare the extern "C"? Because the rule of the target file symbol table compiled by the C compiler and the C compiler is different.

转载请注明原文地址:https://www.9cbs.com/read-39605.html

New Post(0)