Skip to content

Commit 286f2f9

Browse files
authored
Merge pull request MicrosoftDocs#887 from MicrosoftDocs/master
6/12 AM Publish
2 parents 1c2e035 + e0b566e commit 286f2f9

203 files changed

Lines changed: 721 additions & 885 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎docs/assembler/masm/goto-masm.md‎

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "GOTO (MASM) | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "11/04/2016"
4+
ms.date: "06/11/2018"
55
ms.technology: ["cpp-masm"]
66
ms.topic: "reference"
77
f1_keywords: ["goto"]
@@ -11,21 +11,19 @@ ms.assetid: 6a5f73e7-6784-4eae-ac52-4fc77a7f369f
1111
author: "corob-msft"
1212
ms.author: "corob"
1313
ms.workload: ["cplusplus"]
14-
---
15-
# GOTO (MASM)
16-
Transfers assembly to the line marked **:***macrolabel*.
17-
18-
## Syntax
19-
20-
```
21-
22-
GOTO
23-
macrolabel
24-
25-
```
26-
27-
## Remarks
28-
**GOTO** is permitted only inside [MACRO](../../assembler/masm/macro.md), [FOR](../../assembler/masm/for-masm.md), [FORC](../../assembler/masm/forc.md), [REPEAT](../../assembler/masm/repeat.md), and **WHILE** blocks. The label must be the only directive on the line and must be preceded by a leading colon.
29-
30-
## See Also
31-
[Directives Reference](../../assembler/masm/directives-reference.md)
14+
---
15+
# GOTO (MASM)
16+
17+
Transfers assembly to the line marked **:**_macrolabel_.
18+
19+
## Syntax
20+
21+
> **GOTO** *macrolabel*
22+
23+
## Remarks
24+
25+
**GOTO** is permitted only inside [MACRO](macro.md), [FOR](for-masm.md), [FORC](forc.md), [REPEAT](repeat.md), and [WHILE](while-masm.md) blocks. The *macrolabel* target must be the only directive on the line and must be preceded by a leading colon.
26+
27+
## See also
28+
29+
- [Directives Reference](../../assembler/masm/directives-reference.md)

‎docs/cpp/additive-operators-plus-and.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ expression - expression
5959

6060
## Example
6161

62-
```
62+
```cpp
6363
// expre_Additive_Operators.cpp
6464
// compile with: /EHsc
6565
#include <iostream>
@@ -80,7 +80,7 @@ int main() {
8080
## Pointer addition
8181
If one of the operands in an addition operation is a pointer to an array of objects, the other must be of integral type. The result is a pointer that is of the same type as the original pointer and that points to another array element. The following code fragment illustrates this concept:
8282

83-
```
83+
```cpp
8484
short IntArray[10]; // Objects of type short occupy 2 bytes
8585
short *pIntArray = IntArray;
8686

‎docs/cpp/address-of-operator-amp.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ ms.workload: ["cplusplus"]
2828

2929
When the address-of operator is applied to a [qualified name](http://msdn.microsoft.com/en-us/3fefb16d-8120-4627-8b3f-3d90fbdcd1df), the result depends on whether the *qualified-name* specifies a static member. If so, the result is a pointer to the type specified in the declaration of the member. If the member is not static, the result is a pointer to the member *name* of the class indicated by *qualified-class-name*. (See [Primary Expressions](../cpp/primary-expressions.md) for more about *qualified-class-name*.) The following code fragment shows how the result differs, depending on whether the member is static:
3030

31-
```
31+
```cpp
3232
// expre_Address_Of_Operator.cpp
3333
// C2440 expected
3434
class PTM {
@@ -52,7 +52,7 @@ int main() {
5252
5353
## Example
5454
55-
```
55+
```cpp
5656
// expre_Address_Of_Operator2.cpp
5757
// compile with: /EHsc
5858
#include <iostream>
@@ -75,7 +75,7 @@ int main() {
7575

7676
The following example uses the address-of operator to pass a pointer argument to a function:
7777

78-
```
78+
```cpp
7979
// expre_Address_Of_Operator3.cpp
8080
// compile with: /EHsc
8181
// Demonstrate address-of operator &

‎docs/cpp/aliases-and-typedefs-cpp.md‎

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ int main ()
147147

148148
Names declared using `typedef` occupy the same namespace as other identifiers (except statement labels). Therefore, they cannot use the same identifier as a previously declared name, except in a class-type declaration. Consider the following example:
149149

150-
```
150+
```cpp
151151
// typedef_names1.cpp
152152
// C2377 expected
153153
typedef unsigned long UL; // Declare a typedef name, UL.
@@ -156,7 +156,7 @@ int UL; // C2377: redefined.
156156

157157
The name-hiding rules that pertain to other identifiers also govern the visibility of names declared using `typedef`. Therefore, the following example is legal in C++:
158158

159-
```
159+
```cpp
160160
// typedef_names2.cpp
161161
typedef unsigned long UL; // Declare a typedef name, UL
162162
int main()
@@ -168,7 +168,7 @@ int main()
168168
```
169169

170170

171-
```
171+
```cpp
172172
// typedef_specifier1.cpp
173173
typedef char FlagType;
174174

@@ -184,26 +184,26 @@ void myproc( int )
184184
185185
When declaring a local-scope identifier by the same name as a typedef, or when declaring a member of a structure or union in the same scope or in an inner scope, the type specifier must be specified. For example:
186186
187-
```
187+
```cpp
188188
typedef char FlagType;
189189
const FlagType x;
190190
```
191191

192192
To reuse the `FlagType` name for an identifier, a structure member, or a union member, the type must be provided:
193193

194-
```
194+
```cpp
195195
const int FlagType; // Type specifier required
196196
```
197197

198198
It is not sufficient to say
199199

200-
```
200+
```cpp
201201
const FlagType; // Incomplete specification
202202
```
203203

204204
because the `FlagType` is taken to be part of the type, not an identifier that is being redeclared. This declaration is taken to be an illegal declaration like
205205

206-
```
206+
```cpp
207207
int; // Illegal declaration
208208
```
209209

@@ -222,25 +222,25 @@ ulong ul; // Equivalent to "unsigned long ul;"
222222
223223
To use `typedef` to specify fundamental and derived types in the same declaration, you can separate declarators with commas. For example:
224224
225-
```
225+
```cpp
226226
typedef char CHAR, *PSTR;
227227
```
228228

229229
The following example provides the type `DRAWF` for a function returning no value and taking two int arguments:
230230

231-
```
231+
```cpp
232232
typedef void DRAWF( int, int );
233233
```
234234
235235
After the above `typedef` statement, the declaration
236236
237-
```
237+
```cpp
238238
DRAWF box;
239239
```
240240

241241
would be equivalent to the declaration
242242

243-
```
243+
```cpp
244244
void box( int, int );
245245
```
246246
@@ -263,11 +263,11 @@ int main()
263263
ms.f = 0.99;
264264
printf_s("%d %f\n", ms.i, ms.f);
265265
}
266-
```
266+
```
267267

268268
```Output
269269
10 0.990000
270-
```
270+
```
271271

272272
### Re-declaration of typedefs
273273
The `typedef` declaration can be used to redeclare the same name to refer to the same type. For example:
@@ -282,7 +282,7 @@ typedef char CHAR;
282282
// PROG.CPP
283283
#include "file1.h"
284284
#include "file2.h" // OK
285-
```
285+
```
286286

287287
The program PROG.CPP includes two header files, both of which contain `typedef` declarations for the name `CHAR`. As long as both declarations refer to the same type, such redeclaration is acceptable.
288288

@@ -291,7 +291,7 @@ typedef char CHAR;
291291
```cpp
292292
// FILE2.H
293293
typedef int CHAR; // Error
294-
```
294+
```
295295

296296
the compiler issues an error because of the attempt to redeclare the name `CHAR` to refer to a different type. This extends to constructs such as:
297297

@@ -304,7 +304,7 @@ typedef union REGS // OK: name REGS redeclared
304304
struct wordregs x; // same meaning.
305305
struct byteregs h;
306306
} REGS;
307-
```
307+
```
308308

309309
### typedefs in C++ vs. C
310310
Use of the `typedef` specifier with class types is supported largely because of the ANSI C practice of declaring unnamed structures in `typedef` declarations. For example, many C programmers use the following:
@@ -317,17 +317,17 @@ typedef struct { // Declare an unnamed structure and give it the
317317
unsigned x;
318318
unsigned y;
319319
} POINT;
320-
```
320+
```
321321

322322
The advantage of such a declaration is that it enables declarations like:
323323

324-
```
324+
```cpp
325325
POINT ptOrigin;
326-
```
326+
```
327327

328328
instead of:
329329

330-
```
330+
```cpp
331331
struct point_t ptOrigin;
332332
```
333333

‎docs/cpp/alignment-cpp-declarations.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ One of the low-level features of C++ is the ability to specify the precise align
2626

2727
In addition, the compiler pads structures in a way that naturally aligns each element of the structure. Consider the structure struct x_ in the following code example:
2828

29-
```
29+
```cpp
3030
struct x_
3131
{
3232
char a; // 1 byte
@@ -41,7 +41,7 @@ struct x_
4141

4242
The following code example shows how the compiler places the padded structure in memory:Copy
4343

44-
```
44+
```cpp
4545
// Shows the actual memory layout
4646
struct x_
4747
{

‎docs/cpp/alignof-operator.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ C++11 introduces the `alignof` operator that returns the alignment, in bytes, of
4040

4141
The `__alignof` value is the same as the value for `sizeof` for basic types. Consider, however, this example:
4242

43-
```
43+
```cpp
4444
typedef struct { int a; double b; } S;
4545
// __alignof(S) == 8
4646
```
@@ -49,15 +49,15 @@ typedef struct { int a; double b; } S;
4949
5050
Similarly, for
5151
52-
```
52+
```cpp
5353
typedef __declspec(align(32)) struct { int a; } S;
5454
```
5555

5656
`__alignof(S)` is equal to `32`.
5757

5858
One use for `__alignof` would be as a parameter to one of your own memory-allocation routines. For example, given the following defined structure `S`, you could call a memory-allocation routine named `aligned_malloc` to allocate memory on a particular alignment boundary.
5959

60-
```
60+
```cpp
6161
typedef __declspec(align(32)) struct { int a; double b; } S;
6262
int n = 50; // array size
6363
S* p = (S*)aligned_malloc(n * sizeof(S), __alignof(S));

‎docs/cpp/allocate.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ ms.workload: ["cplusplus"]
4040

4141
## Example
4242

43-
```
43+
```cpp
4444
// allocate.cpp
4545
#pragma section("mycode", read)
4646
__declspec(allocate("mycode")) int i = 0;

‎docs/cpp/anonymous-class-types.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ms.workload: ["cplusplus"]
1414
# Anonymous Class Types
1515
Classes can be anonymous — that is, they can be declared without an *identifier*. This is useful when you replace a class name with a `typedef` name, as in the following:
1616

17-
```
17+
```cpp
1818
typedef struct
1919
{
2020
unsigned x;
@@ -27,7 +27,7 @@ typedef struct
2727
2828
Anonymous classes are also useful when you want a reference to a class member to appear as though it were not contained in a separate class, as in the following:
2929

30-
```
30+
```cpp
3131
struct PTValue
3232
{
3333
POINT ptLoc;
@@ -43,7 +43,7 @@ PTValue ptv;
4343

4444
In the preceding code, `iValue` can be accessed using the object member-selection operator (**.**) as follows:
4545

46-
```
46+
```cpp
4747
int i = ptv.iValue;
4848
```
4949

@@ -62,7 +62,7 @@ int i = ptv.iValue;
6262

6363
You can access the members of an anonymous structure as if they were members in the containing structure.
6464

65-
```
65+
```cpp
6666
// anonymous_structures.c
6767
#include <stdio.h>
6868

‎docs/cpp/argument-definitions.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ms.workload: ["cplusplus"]
1414
# Argument Definitions
1515
The arguments in the prototype
1616

17-
```
17+
```cpp
1818

1919
int main( int argc, char* argv[], char* envp[]);
2020
int wmain( int argc, wchar_t* argv[], wchar_t* envp[]);
@@ -42,7 +42,7 @@ int wmain( int argc, wchar_t* argv[], wchar_t* envp[]);
4242
## Example
4343
The following example shows how to use the `argc`, `argv`, and `envp` arguments to **main**:
4444
45-
```
45+
```cpp
4646
// argument_definitions.cpp
4747
// compile with: /EHsc
4848
#include <iostream>

‎docs/cpp/argument-dependent-name-koenig-lookup-on-functions.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The compiler can use argument-dependent name lookup to find the definition of an
1717
## Example
1818
In the sample, the compiler notes that function `f()` takes an argument `x`. Argument `x` is of type `A::X`, which is defined in namespace `A`. The compiler searches namespace `A` and finds a definition for function `f()` that takes an argument of type `A::X`.
1919

20-
```
20+
```cpp
2121
// argument_dependent_name_koenig_lookup_on_functions.cpp
2222
namespace A
2323
{

0 commit comments

Comments
 (0)