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
Finds the next token in a string, by using the current locale or a locale that's passed in. These versions of [strtok, _strtok_l, wcstok, _wcstok_l, _mbstok, _mbstok_l](../../c-runtime-library/reference/strtok-strtok-l-wcstok-wcstok-l-mbstok-mbstok-l.md) have security enhancements, as described in [Security Features in the CRT](../../c-runtime-library/security-features-in-the-crt.md).
80
81
81
82
> [!IMPORTANT]
82
83
> `_mbstok_s` and `_mbstok_s_l` cannot be used in applications that execute in the Windows Runtime. For more information, see [CRT functions not supported with /ZW](http://msdn.microsoft.com/library/windows/apps/jj606124.aspx).
83
84
84
85
## Syntax
85
86
86
-
```
87
-
88
-
char *strtok_s(
89
-
char *strToken,
90
-
const char *strDelimit,
91
-
char **context
92
-
);
93
-
char *_strtok_s_l(
94
-
char *strToken,
95
-
const char *strDelimit,
96
-
char **context,
97
-
_locale_tlocale
98
-
);
99
-
wchar_t *wcstok_s(
100
-
wchar_t *strToken,
101
-
const wchar_t *strDelimit,
102
-
wchar_t**context
87
+
```
88
+
char* strtok_s(
89
+
char* str,
90
+
const char* delimiters,
91
+
char** context
92
+
);
93
+
94
+
char* _strtok_s_l(
95
+
char* str,
96
+
const char* delimiters,
97
+
char** context,
98
+
_locale_t locale
103
99
);
100
+
101
+
wchar_t* wcstok_s(
102
+
wchar_t* str,
103
+
const wchar_t* delimiters,
104
+
wchar_t** context
105
+
);
106
+
104
107
wchar_t *_wcstok_s_l(
105
-
wchar_t *strToken,
106
-
const wchar_t *strDelimit,
107
-
wchar_t**context,
108
-
_locale_tlocale
108
+
wchar_t* str,
109
+
const wchar_t* delimiters,
110
+
wchar_t**context,
111
+
_locale_t locale
109
112
);
110
-
unsigned char *_mbstok_s(
111
-
unsigned char*strToken,
112
-
const unsigned char *strDelimit,
113
-
char **context
113
+
114
+
unsigned char* _mbstok_s(
115
+
unsigned char* str,
116
+
const unsigned char* delimiters,
117
+
char** context
114
118
);
115
-
unsigned char *_mbstok_s(
116
-
unsigned char*strToken,
117
-
const unsigned char *strDelimit,
118
-
char **context,
119
-
_locale_tlocale
119
+
120
+
unsigned char* _mbstok_s(
121
+
unsigned char* str,
122
+
const unsigned char* delimiters,
123
+
char** context,
124
+
_locale_t locale
120
125
);
121
126
```
122
127
123
-
#### Parameters
124
-
`strToken`
125
-
String containing token or tokens.
128
+
### Parameters
129
+
130
+
*str*
131
+
A string containing the token or tokens to find.
126
132
127
-
`strDelimit`
128
-
Set of delimiter characters.
133
+
*delimiters*
134
+
The set of delimiter characters to use.
129
135
130
-
`context`
131
-
Used to store position information between calls to `strtok_s`
136
+
*context*
137
+
Used to store position information between calls to the function.
132
138
133
-
`locale`
134
-
Locale to use.
139
+
*locale*
140
+
The locale to use.
135
141
136
142
## Return Value
137
-
Returns a pointer to the next token found in `strToken`. They return `NULL` when no more tokens are found. Each call modifies `strToken` by substituting a `NULL` character for the first delimiter that occurs after the returned token.
143
+
144
+
Returns a pointer to the next token found in *str*. Returns `NULL` when no more tokens are found. Each call modifies *str* by substituting a `NULL` character for the first delimiter that occurs after the returned token.
|`NULL`|any|pointer to a null pointer|`NULL`|`EINVAL`|
144
151
|any|`NULL`|any|`NULL`|`EINVAL`|
145
152
|any|any|`NULL`|`NULL`|`EINVAL`|
146
153
147
-
If `strToken` is `NULL` but context is a pointer to a valid context pointer, there is no error.
154
+
If *str* is `NULL` but *context* is a pointer to a valid context pointer, there is no error.
148
155
149
156
## Remarks
150
-
The `strtok_s` function finds the next token in `strToken`. The set of characters in `strDelimit` specifies possible delimiters of the token to be found in `strToken` on the current call. `wcstok_s` and `_mbstok_s` are wide-character and multibyte-character versions of `strtok_s`. The arguments and return values of `wcstok_s` and `_wcstok_s_l` are wide-character strings; those of `_mbstok_s` and `_mbstok_s_l` are multibyte-character strings. These three functions behave identically otherwise.
151
-
152
-
This function validates its parameters. If an error condition occurs, as in the Error Conditions table, the invalid parameter handler is invoked, as described in [Parameter Validation](../../c-runtime-library/parameter-validation.md). If execution is allowed to continue, these functions set `errno` to `EINVAL` and return `NULL`.
153
-
154
-
### Generic-Text Routine Mappings
155
-
156
-
|TCHAR.H routine|_UNICODE & _MBCS not defined|_MBCS defined|_UNICODE defined|
On the first call to `strtok_s` the function skips leading delimiters and returns a pointer to the first token in `strToken`, terminating the token with a null character. More tokens can be broken out of the remainder of `strToken` by a series of calls to `strtok_s`. Each call to `strtok_s` modifies `strToken` by inserting a null character after the token returned by that call. The `context` pointer keeps track of which string is being read and where in the string the next token is to be read. To read the next token from `strToken`, call `strtok_s` with a `NULL` value for the `strToken` argument, and pass the same `context` parameter. The `NULL``strToken` argument causes `strtok_s` to search for the next token in the modified `strToken`. The `strDelimit` argument can take any value from one call to the next so that the set of delimiters may vary.
162
-
163
-
Since the `context` parameter supersedes the static buffers used in `strtok` and `_strtok_l`, it is possible to parse two strings simultaneously in the same thread.
164
-
165
-
The output value is affected by the setting of the `LC_CTYPE` category setting of the locale; see [setlocale](../../c-runtime-library/reference/setlocale-wsetlocale.md) for more information. The versions of these functions without the `_l` suffix use the current locale for this locale-dependent behavior; the versions with the `_l` suffix are identical except that they use the locale parameter passed in instead. For more information, see [Locale](../../c-runtime-library/locale.md).
166
-
167
-
## Requirements
168
-
169
-
|Routine|Required header|
170
-
|-------------|---------------------|
171
-
|`strtok_s`|\<string.h>|
172
-
|`_strtok_s_l`|\<string.h>|
173
-
|`wcstok_s`,<br /><br /> `_wcstok_s_l`|\<string.h> or \<wchar.h>|
For additional compatibility information, see [Compatibility](../../c-runtime-library/compatibility.md).
177
-
178
-
## Example
179
-
180
-
```
181
-
// crt_strtok_s.c
182
-
// In this program, a loop uses strtok_s
183
-
// to print all the tokens (separated by commas
184
-
// or blanks) in two strings at the same time.
185
-
//
186
-
187
-
#include <string.h>
188
-
#include <stdio.h>
189
-
190
-
char string1[] =
191
-
"A string\tof ,,tokens\nand some more tokens";
192
-
char string2[] =
193
-
"Another string\n\tparsed at the same time.";
194
-
char seps[] = " ,\t\n";
195
-
char *token1 = NULL;
196
-
char *token2 = NULL;
197
-
char *next_token1 = NULL;
198
-
char *next_token2 = NULL;
199
-
200
-
int main(void )
201
-
{
202
-
printf("Tokens:\n" );
203
-
204
-
// Establish string and get the first token:
205
-
token1 = strtok_s(string1, seps, &next_token1);
206
-
token2 = strtok_s ( string2, seps, &next_token2);
207
-
208
-
// While there are tokens in "string1" or "string2"
209
-
while ((token1 != NULL) || (token2 != NULL))
210
-
{
211
-
// Get next token:
212
-
if (token1 != NULL)
213
-
{
214
-
printf(" %s\n", token1 );
215
-
token1 = strtok_s(NULL, seps, &next_token1);
216
-
}
217
-
if (token2 != NULL)
218
-
{
219
-
printf(" %s\n", token2 );
220
-
token2 = strtok_s(NULL, seps, &next_token2);
221
-
}
222
-
}
223
-
}
157
+
158
+
The `strtok_s` family of functions finds the next token in *str*. The set of characters in *delimiters* specifies possible delimiters of the token to be found in *str* on the current call. `wcstok_s` and `_mbstok_s` are wide-character and multibyte-character versions of `strtok_s`. The arguments and return values of `wcstok_s` and `_wcstok_s_l` are wide-character strings; those of `_mbstok_s` and `_mbstok_s_l` are multibyte-character strings. These functions behave identically otherwise.
159
+
160
+
This function validates its parameters. If an error condition occurs, as in the Error Conditions table, the invalid parameter handler is invoked, as described in [Parameter Validation](../../c-runtime-library/parameter-validation.md). If execution is allowed to continue, these functions set `errno` to `EINVAL` and return `NULL`.
161
+
162
+
On the first call to `strtok_s` the function skips leading delimiters and returns a pointer to the first token in *str*, terminating the token with a null character. More tokens can be broken out of the remainder of *str* by a series of calls to `strtok_s`. Each call to `strtok_s` modifies *str* by inserting a null character after the token returned by that call. The *context* pointer keeps track of which string is being read and where in the string the next token is to be read. To read the next token from *str*, call `strtok_s` with a `NULL` value for the *str* argument, and pass the same *context* parameter. The `NULL`*str* argument causes `strtok_s` to search for the next token in the modified *str*. The *delimiters* argument can take any value from one call to the next so that the set of delimiters may vary.
163
+
164
+
Since the *context* parameter supersedes the static buffers used in `strtok` and `_strtok_l`, it is possible to parse two strings simultaneously in the same thread.
165
+
166
+
The output value is affected by the setting of the `LC_CTYPE` category setting of the locale; see [setlocale](../../c-runtime-library/reference/setlocale-wsetlocale.md) for more information. The versions of these functions without the `_l` suffix use the current thread locale for this locale-dependent behavior. The versions with the `_l` suffix are identical except that they instead use the *locale* parameter. For more information, see [Locale](../../c-runtime-library/locale.md).
167
+
168
+
## Requirements
169
+
170
+
|Routine|Required header|
171
+
|-------------|---------------------|
172
+
|`strtok_s`|\<string.h>|
173
+
|`_strtok_s_l`|\<string.h>|
174
+
|`wcstok_s`,<br />`_wcstok_s_l`|\<string.h> or \<wchar.h>|
175
+
|`_mbstok_s`,<br />`_mbstok_s_l`|\<mbstring.h>|
176
+
177
+
For additional compatibility information, see [Compatibility](../../c-runtime-library/compatibility.md).
178
+
179
+
### Generic-Text Routine Mappings
180
+
181
+
|TCHAR.H routine|\_UNICODE & \_MBCS not defined|\_MBCS defined|_UNICODE defined|
Copy file name to clipboardExpand all lines: docs/error-messages/compiler-errors-1/fatal-error-c1001.md
+9-8Lines changed: 9 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -35,12 +35,13 @@ translation.priority.ht:
35
35
- "zh-tw"
36
36
---
37
37
# Fatal Error C1001
38
-
INTERNAL COMPILER ERROR(compiler file file, line number)
38
+
39
+
> INTERNAL COMPILER ERROR(compiler file *file*, line *number*)
39
40
40
-
The compiler cannot generate correct code for a construct, probably due to the combination of an expression and an optimization option. Try removing one or more optimization options and recompiling the function containing the line indicated in the error message.
41
-
42
-
You can probably fix the problem by removing one or more optimization options. To determine which option is at fault, remove options one at a time and recompile until the error message goes away. The options most commonly responsible are **/Og**, **/Oi**, and `/Oa`. Once you determine which option is responsible, you can disable it using the [optimize](../../preprocessor/optimize.md) pragma around the function where the error occurs and continue to use the option for the rest of the module.
43
-
44
-
The Microsoft Knowledge Base has more information about C1001; see [http://support.microsoft.com/default.aspx?scid=kb;en-us;134650](http://support.microsoft.com/default.aspx?scid=kb;en-us;134650).
45
-
46
-
Try rewriting the line where the error is reported, or several lines of code surrounding that line.
41
+
The compiler cannot generate correct code for a construct, often due to the combination of a particular expression and an optimization option, or an issue in parsing. If the compiler file listed has a utc or C2 path segment, it is probably an optimization error. If the file has a cxxfe or c1xx path segment, or is msc1.cpp, it is probably a parser error. If the file named is cl.exe, there is no other information available.
42
+
43
+
You can often fix an optimization problem by removing one or more optimization options. To determine which option is at fault, remove options one at a time and recompile until the error message goes away. The options most commonly responsible are [/Og (Global optimizations)](../../build/reference/og-global-optimizations.md) and [/Oi (Generate Intrinsic Functions)](../../build/reference/oi-generate-intrinsic-functions.md). Once you determine which optimization option is responsible, you can disable it around the function where the error occurs by using the [optimize](../../preprocessor/optimize.md) pragma, and continue to use the option for the rest of the module. For more information about optimization options, see [Optimization best practices](../../build/reference/optimization-best-practices.md).
44
+
45
+
If optimizations are not responsible for the error, try rewriting the line where the error is reported, or several lines of code surrounding that line. To see the code the way the compiler sees it after preprocessing, you can use the [/P (Preprocess to a file)](../../build/reference/p-preprocess-to-a-file.md) option.
46
+
47
+
For more information about how to isolate the source of the error and how to report an internal compiler error to Microsoft, see [How to Report a Problem with the Visual C++ Toolset](../../how-to-report-a-problem-with-the-visual-cpp-toolset.md).
Copy file name to clipboardExpand all lines: docs/linux/create-a-new-linux-project.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: "Create a New Linux Project | Microsoft Docs"
3
3
ms.custom: ""
4
-
ms.date: "11/16/2016"
4
+
ms.date: "08/16/2017"
5
5
ms.reviewer: ""
6
6
ms.suite: ""
7
7
ms.technology:
@@ -33,7 +33,7 @@ translation.priority.ht:
33
33
To create a new Linux project in Visual Studio, do the following:
34
34
35
35
1. Select **File > New Project** in Visual Studio, or press **Ctrl + Shift + N**.
36
-
1. Select the **Templates > Other Languages > Visual C++ > Cross Platform > Linux** node and then select the project type you would like to create, enter a Name/Location, and click OK.
36
+
1. Select the **Visual C++ > Cross Platform > Linux** node and then select the project type you would like to create, enter a Name/Location, and click OK.
0 commit comments