You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These functions return a value of 0 if successful. A return value of -1 indicates failure. If the specified path could not be found, **errno** is set to **ENOENT**. If *dirname* is **NULL**, the invalid parameter handler is invoked, as described in [Parameter Validation](../../c-runtime-library/parameter-validation.md). If execution is allowed to continue, **errno** is set to **EINVAL** and the function returns -1.
34
+
These functions return a value of 0 if successful. A return value of -1 indicates failure. If the specified path couldn't be found, **`errno`** is set to **`ENOENT`**. If *`dirname`* is **`NULL`**, the invalid parameter handler is invoked, as described in [Parameter Validation](../../c-runtime-library/parameter-validation.md). If execution is allowed to continue, **`errno`** is set to **`EINVAL`** and the function returns -1.
36
35
37
36
## Remarks
38
37
39
-
The **_chdir** function changes the current working directory to the directory specified by *dirname*. The *dirname* parameter must refer to an existing directory. This function can change the current working directory on any drive. If a new drive letter is specified in *dirname*, the default drive letter is changed as well. For example, if A is the default drive letter and \BIN is the current working directory, the following call changes the current working directory for drive C and establishes C as the new default drive:
38
+
The **`_chdir`** function changes the current working directory to the directory specified by *`dirname`*. The *`dirname`* parameter must refer to an existing directory. This function can change the current working directory on any drive. If a new drive letter is specified in *`dirname`*, the default drive letter is changed as well. For example, if A is the default drive letter and \BIN is the current working directory, the following call changes the current working directory for drive C and establishes C as the new default drive:
40
39
41
40
```C
42
41
_chdir("c:\temp");
43
42
```
44
43
45
44
When you use the optional backslash character (**`\`**) in paths, you must place two backslashes (**`\\`**) in a C string literal to represent a single backslash (**`\`**).
46
45
47
-
**_wchdir** is a wide-character version of **_chdir**; the *dirname* argument to **_wchdir** is a wide-character string. **_wchdir** and **_chdir** behave identically otherwise.
46
+
**`_wchdir`** is a wide-character version of **`_chdir`**; the *`dirname`* argument to **`_wchdir`** is a wide-character string. **`_wchdir`** and **`_chdir`** behave identically otherwise.
48
47
49
48
By default, this function's global state is scoped to the application. To change this, see [Global state in the CRT](../global-state.md).
50
49
51
50
### Generic-Text Routine Mapping:
52
51
53
-
|Tchar.h routine|_UNICODE and _MBCS not defined|_MBCS defined|_UNICODE defined|
52
+
|`Tchar.h` routine|`_UNICODE and _MBCS` not defined|`_MBCS` defined|`_UNICODE` defined|
Copy file name to clipboardExpand all lines: docs/c-runtime-library/reference/fmod-fmodf.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,11 +47,11 @@ Floating-point values.
47
47
48
48
## Return Value
49
49
50
-
**`fmod`** returns the floating-point remainder of *`x`* / *`y`*. If the value of *`y`* is 0.0, **`fmod`** returns a quiet NaN. For information about representation of a quiet NaN by the **`printf`** family, see [printf](printf-printf-l-wprintf-wprintf-l.md).
50
+
**`fmod`** returns the floating-point remainder of `x / y`. If the value of *`y`* is 0.0, **`fmod`** returns a quiet `NaN`. For information about representation of a quiet `NaN` by the **`printf`** family, see [`printf`](printf-printf-l-wprintf-wprintf-l.md).
51
51
52
52
## Remarks
53
53
54
-
The **`fmod`** function calculates the floating-point remainder *f* of *`x`* / *`y`* such that *`x`* = *i* \* *`y`* + *`f`*, where *`i`* is an integer, *`f`* has the same sign as *`x`*, and the absolute value of *`f`* is less than the absolute value of *`y`*.
54
+
The **`fmod`** function calculates the floating-point remainder *`f`* of `x / y` such that `x = i * y + f`, where *`i`* is an integer, *`f`* has the same sign as *`x`*, and the absolute value of *`f`* is less than the absolute value of *`y`*.
55
55
56
56
C++ allows overloading, so you can call overloads of **`fmod`** that take and return **`float`** and **`long double`** values. In a C program, unless you're using the `<tgmath.h>` macro to call this function, **`fmod`** always takes two **`double`** arguments and returns a **`double`**.
The **free** function deallocates a memory block (*memblock*) that was previously allocated by a call to **calloc**, **malloc**, or **realloc**. The number of freed bytes is equivalent to the number of bytes requested when the block was allocated (or reallocated, in the case of **realloc**). If *memblock* is **NULL**, the pointer is ignored and **free** immediately returns. Attempting to free an invalid pointer (a pointer to a memory block that was not allocated by **calloc**, **malloc**, or **realloc**) may affect subsequent allocation requests and cause errors.
31
+
The **`free`** function deallocates a memory block (*`memblock`*) that was previously allocated by a call to **`calloc`**, **`malloc`**, or **`realloc`**. The number of freed bytes is equivalent to the number of bytes requested when the block was allocated (or reallocated, in the case of **`realloc`**). If *`memblock`* is **`NULL`**, the pointer is ignored and **`free`** immediately returns. Attempting to free an invalid pointer (a pointer to a memory block that wasn't allocated by **`calloc`**, **`malloc`**, or **`realloc`**) may affect subsequent allocation requests and cause errors.
33
32
34
-
If an error occurs in freeing the memory, **errno** is set with information from the operating system on the nature of the failure. For more information, see [errno, _doserrno, _sys_errlist, and _sys_nerr](../../c-runtime-library/errno-doserrno-sys-errlist-and-sys-nerr.md).
33
+
If an error occurs in freeing the memory, **`errno`** is set with information from the operating system on the nature of the failure. For more information, see [`errno`, `_doserrno`, `_sys_errlist`, and `_sys_nerr`](../../c-runtime-library/errno-doserrno-sys-errlist-and-sys-nerr.md).
35
34
36
-
After a memory block has been freed, [_heapmin](heapmin.md) minimizes the amount of free memory on the heap by coalescing the unused regions and releasing them back to the operating system. Freed memory that is not released to the operating system is restored to the free pool and is available for allocation again.
35
+
After a memory block has been freed, [`_heapmin`](heapmin.md) minimizes the amount of free memory on the heap by coalescing the unused regions and releasing them back to the operating system. Freed memory that isn't released to the operating system is restored to the free pool and is available for allocation again.
37
36
38
-
When the application is linked with a debug version of the C run-time libraries, **free** resolves to [_free_dbg](free-dbg.md). For more information about how the heap is managed during the debugging process, see [The CRT Debug Heap](/visualstudio/debugger/crt-debug-heap-details).
37
+
When the application is linked with a debug version of the C run-time libraries, **`free`** resolves to [`_free_dbg`](free-dbg.md). For more information about how the heap is managed during the debugging process, see [The CRT Debug Heap](/visualstudio/debugger/crt-debug-heap-details).
39
38
40
-
**free** is marked `__declspec(noalias)`, meaning that the function is guaranteed not to modify global variables. For more information, see [noalias](../../cpp/noalias.md).
39
+
**`free`** is marked `__declspec(noalias)`, meaning that the function is guaranteed not to modify global variables. For more information, see [`noalias`](../../cpp/noalias.md).
41
40
42
-
To free memory allocated with [_malloca](malloca.md), use [_freea](freea.md).
41
+
To free memory allocated with [`_malloca`](malloca.md), use [`_freea`](freea.md).
43
42
44
43
By default, this function's global state is scoped to the application. To change this, see [Global state in the CRT](../global-state.md).
45
44
46
45
## Requirements
47
46
48
47
|Function|Required header|
49
48
|--------------|---------------------|
50
-
|**free**|\<stdlib.h> and \<malloc.h>|
49
+
|**`free`**|`<stdlib.h>` and `<malloc.h>`|
51
50
52
51
For additional compatibility information, see [Compatibility](../../c-runtime-library/compatibility.md).
Returns the size of a memory block allocated in the heap.
16
15
@@ -24,28 +23,28 @@ size_t _msize(
24
23
25
24
### Parameters
26
25
27
-
*memblock*<br/>
26
+
*`memblock`*\
28
27
Pointer to the memory block.
29
28
30
29
## Return Value
31
30
32
-
**_msize** returns the size (in bytes) as an unsigned integer.
31
+
**`_msize`** returns the size (in bytes) as an unsigned integer.
33
32
34
33
## Remarks
35
34
36
-
The **_msize** function returns the size, in bytes, of the memory block allocated by a call to **calloc**, **malloc**, or **realloc**.
35
+
The **`_msize`** function returns the size, in bytes, of the memory block allocated by a call to **`calloc`**, **`malloc`**, or **`realloc`**.
37
36
38
-
When the application is linked with a debug version of the C run-time libraries, **_msize** resolves to [_msize_dbg](msize-dbg.md). For more information about how the heap is managed during the debugging process, see [The CRT Debug Heap](/visualstudio/debugger/crt-debug-heap-details).
37
+
When the application is linked with a debug version of the C run-time libraries, **`_msize`** resolves to [`_msize_dbg`](msize-dbg.md). For more information about how the heap is managed during the debugging process, see [The CRT Debug Heap](/visualstudio/debugger/crt-debug-heap-details).
39
38
40
-
This function validates its parameter. If *memblock* is a null pointer, **_msize** invokes an invalid parameter handler, as described in [Parameter Validation](../../c-runtime-library/parameter-validation.md). If the error is handled, the function sets **errno** to **EINVAL** and returns -1.
39
+
This function validates its parameter. If *`memblock`* is a `NULL` pointer, **`_msize`** invokes an invalid parameter handler, as described in [Parameter Validation](../../c-runtime-library/parameter-validation.md). If the error is handled, the function sets **`errno`** to **`EINVAL`** and returns -1.
41
40
42
41
By default, this function's global state is scoped to the application. To change this, see [Global state in the CRT](../global-state.md).
43
42
44
43
## Requirements
45
44
46
45
|Routine|Required header|
47
46
|-------------|---------------------|
48
-
|**_msize**|\<malloc.h>|
47
+
|**`_msize`**|`<malloc.h>`|
49
48
50
49
For more compatibility information, see [Compatibility](../../c-runtime-library/compatibility.md).
51
50
@@ -55,12 +54,12 @@ All versions of the [C run-time libraries](../../c-runtime-library/crt-library-f
The global security cookie is used for buffer overrun protection in code compiled with [/GS (Buffer Security Check)](../../build/reference/gs-buffer-security-check.md) and in code that uses exception handling. On entry to an overrun-protected function, the cookie is put on the stack, and on exit, the value on the stack is compared with the global cookie. Any difference between them indicates that a buffer overrun has occurred and causes immediate termination of the program.
26
25
27
-
Normally, **__security_init_cookie** is called by the CRT when it is initialized. If you bypass CRT initialization—for example, if you use [/ENTRY](../../build/reference/entry-entry-point-symbol.md) to specify an entry-point—then you must call **__security_init_cookie** yourself. If **__security_init_cookie** is not called, the global security cookie is set to a default value and buffer overrun protection is compromised. Because an attacker can exploit this default cookie value to defeat the buffer overrun checks, we recommend that you always call **__security_init_cookie** when you define your own entry point.
26
+
Normally, **`__security_init_cookie`** is called by the CRT when it's initialized. If you bypass CRT initialization—for example, if you use [`/ENTRY`](../../build/reference/entry-entry-point-symbol.md) to specify an entry-point—then you must call **`__security_init_cookie`** yourself. If **`__security_init_cookie`** isn't called, the global security cookie is set to a default value and buffer overrun protection is compromised. Because an attacker can exploit this default cookie value to defeat the buffer overrun checks, we recommend that you always call **`__security_init_cookie`** when you define your own entry point.
28
27
29
-
The call to **__security_init_cookie** must be made before any overrun-protected function is entered; otherwise a spurious buffer overrun will be detected. For more information, see [C Runtime Error R6035](../../error-messages/tool-errors/c-runtime-error-r6035.md).
28
+
The call to **`__security_init_cookie`** must be made before any overrun-protected function is entered; otherwise a spurious buffer overrun will be detected. For more information, see [C Runtime Error R6035](../../error-messages/tool-errors/c-runtime-error-r6035.md).
30
29
31
30
## Example
32
31
@@ -36,9 +35,9 @@ See the examples in [C Runtime Error R6035](../../error-messages/tool-errors/c-r
36
35
37
36
|Routine|Required header|
38
37
|-------------|---------------------|
39
-
|**__security_init_cookie**|\<process.h>|
38
+
|**`__security_init_cookie`**|`<process.h>`|
40
39
41
-
**__security_init_cookie** is a Microsoft extension to the standard C Runtime Library. For compatibility information, see [Compatibility](../../c-runtime-library/compatibility.md).
40
+
**`__security_init_cookie`** is a Microsoft extension to the standard C Runtime Library. For compatibility information, see [Compatibility](../../c-runtime-library/compatibility.md).
0 commit comments