Skip to content

Commit 1d6fb56

Browse files
author
Colin Robertson
authored
Merge pull request #3576 from MicrosoftDocs/main637745856831611491
Repo sync for protected CLA branch
2 parents 021e818 + fe95811 commit 1d6fb56

11 files changed

+741
-599
lines changed

.openpublishing.redirection.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1360,11 +1360,6 @@
13601360
"redirect_url": "/cpp/get-started/tutorial-console-cpp",
13611361
"redirect_document_id": false
13621362
},
1363-
{
1364-
"source_path": "docs/get-started/index.yml",
1365-
"redirect_url": "/cpp/get-started/tutorial-console-cpp",
1366-
"redirect_document_id": false
1367-
},
13681363
{
13691364
"source_path": "docs/ide/adding-references-in-visual-cpp-projects.md",
13701365
"redirect_url": "/cpp/build/adding-references-in-visual-cpp-projects",

docs/cpp/member-access-operators-dot-and.md

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,28 @@
11
---
2-
description: "Learn more about: Member Access Operators: . and ->"
3-
title: "Member Access Operators: . and ->"
4-
ms.date: "11/04/2016"
2+
description: "Learn more about: Member access operators: '.' and '->'"
3+
title: "Member access operators: '.' and '->'"
4+
ms.date: 12/04/2021
55
f1_keywords: [".", "->"]
66
helpviewer_keywords: ["member access, expressions", "operators [C++], member access", "dot operator (.)", "-> operator", "member access, operators", "postfix operators [C++]", ". operator", "member access"]
77
ms.assetid: f8fc3df9-d728-40c5-b384-276927f5f1b3
88
---
9-
# Member Access Operators: `.` and `->`
9+
# Member access operators: `.` and `->`
1010

1111
## Syntax
1212

13-
```
14-
postfix-expression . name
15-
postfix-expression -> name
16-
```
13+
*`postfix-expression`*:\
14+
&emsp; *`postfix-expression`* **`.`** **`template`**<sub>opt</sub> *`id-expression`*\
15+
&emsp; *`postfix-expression`* **`->`** **`template`**<sub>opt</sub> *`id-expression`*
1716

1817
## Remarks
1918

20-
The member access operators **.** and **->** are used to refer to members of structures, unions, and classes. Member access expressions have the value and type of the selected member.
19+
The member access operators **`.`** and **`->`** are used to refer to members of `struct`, `union`, and `class` types. Member access expressions have the value and type of the selected member.
2120

2221
There are two forms of member access expressions:
2322

24-
1. In the first form, *postfix-expression* represents a value of struct, class, or union type, and *name* names a member of the specified structure, union, or class. The value of the operation is that of *name* and is an l-value if *postfix-expression* is an l-value.
23+
1. In the first form, *`postfix-expression`* represents a value of `struct`, `class`, or `union` type, and *`id-expression`* names a member of the specified `struct`, `union`, or `class`. The value of the operation is that of *`id-expression`* and is an l-value if *`postfix-expression`* is an l-value.
2524

26-
1. In the second form, *postfix-expression* represents a pointer to a structure, union, or class, and *name* names a member of the specified structure, union, or class. The value is that of *name* and is an l-value. The **->** operator dereferences the pointer. Therefore, the expressions `e->member` and `(*e).member` (where *e* represents a pointer) yield identical results (except when the operators **->** or <strong>\*</strong> are overloaded).
25+
1. In the second form, *`postfix-expression`* represents a pointer to a `struct`, `union`, or `class`, and *`id-expression`* names a member of the specified `struct`, `union`, or `class`. The value is that of `id-expression` and is an l-value. The **`->`** operator dereferences the pointer. The expressions `e->member` and `(*(e)).member` (where *`e`* represents a pointer) yield identical results (except when the operators **`->`** or **`*`** are overloaded).
2726

2827
## Example
2928

@@ -63,7 +62,7 @@ int main() {
6362

6463
## See also
6564

66-
[Postfix Expressions](../cpp/postfix-expressions.md)<br/>
67-
[C++ Built-in Operators, Precedence and Associativity](../cpp/cpp-built-in-operators-precedence-and-associativity.md)<br/>
68-
[Classes and Structs](../cpp/classes-and-structs-cpp.md)<br/>
69-
[Structure and Union Members](../c-language/structure-and-union-members.md)
65+
[Postfix expressions](../cpp/postfix-expressions.md)\
66+
[C++ built-in operators, precedence, and associativity](../cpp/cpp-built-in-operators-precedence-and-associativity.md)\
67+
[Classes and Structs](../cpp/classes-and-structs-cpp.md)\
68+
[Structure and union members](../c-language/structure-and-union-members.md)

docs/cpp/pointer-to-member-operators-dot-star-and-star.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
---
2-
description: "Learn more about: Pointer-to-Member Operators: .* and ->*"
3-
title: "Pointer-to-Member Operators: .* and ->*"
4-
ms.date: "11/04/2016"
2+
description: "Learn more about: Pointer-to-member operators: '.*' and '->*'"
3+
title: "Pointer-to-member operators: '.*' and '->*'"
4+
ms.date: 12/04/2021
55
f1_keywords: [".*", "->*"]
66
helpviewer_keywords: ["expressions [C++], pointer", "pointer-to-member operators [C++]", ".* operator", "expressions [C++], operators", "->* operator"]
77
ms.assetid: 2632be3f-1c81-4523-b56c-982a92a68688
88
---
9-
# Pointer-to-Member Operators: `.*` and `->*`
9+
# Pointer-to-member operators: `.*` and `->*`
1010

1111
## Syntax
1212

13-
```
14-
expression .* expression
15-
expression ->* expression
16-
```
13+
*`pm-expression`*:\
14+
&emsp; *`cast-expression`*\
15+
&emsp; *`pm-expression`* **`.*`** *`cast-expression`*\
16+
&emsp; *`pm-expression`* **`->*`** *`cast-expression`*
1717

1818
## Remarks
1919

20-
The pointer-to-member operators, .* and ->\*, return the value of a specific class member for the object specified on the left side of the expression. The right side must specify a member of the class. The following example shows how to use these operators:
20+
The pointer-to-member operators **`.*`** and **`->*`** return the value of a specific class member for the object specified on the left side of the expression. The right side must specify a member of the class. The following example shows how to use these operators:
2121

2222
```cpp
2323
// expre_Expressions_with_Pointer_Member_Operators.cpp
@@ -68,13 +68,13 @@ m_func1
6868

6969
In the preceding example, a pointer to a member, `pmfn`, is used to invoke the member function `m_func1`. Another pointer to a member, `pmd`, is used to access the `m_num` member.
7070

71-
The binary operator .* combines its first operand, which must be an object of class type, with its second operand, which must be a pointer-to-member type.
71+
The binary operator **`.*`** combines its first operand, which must be an object of class type, with its second operand, which must be a pointer-to-member type.
7272

73-
The binary operator ->* combines its first operand, which must be a pointer to an object of class type, with its second operand, which must be a pointer-to-member type.
73+
The binary operator **`->*`** combines its first operand, which must be a pointer to an object of class type, with its second operand, which must be a pointer-to-member type.
7474

75-
In an expression containing the .* operator, the first operand must be of the class type of, and be accessible to, the pointer to member specified in the second operand or of an accessible type unambiguously derived from and accessible to that class.
75+
In an expression containing the **`.*`** operator, the first operand must be of the class type of, and be accessible to, the pointer to member specified in the second operand or of an accessible type unambiguously derived from and accessible to that class.
7676

77-
In an expression containing the ->* operator, the first operand must be of the type "pointer to the class type" of the type specified in the second operand, or it must be of a type unambiguously derived from that class.
77+
In an expression containing the **`->*`** operator, the first operand must be of the type "pointer to the class type" of the type specified in the second operand, or it must be of a type unambiguously derived from that class.
7878

7979
## Example
8080

@@ -116,11 +116,11 @@ int main() {
116116
}
117117
```
118118
119-
The result of the .* or ->\* pointer-to-member operators is an object or function of the type specified in the declaration of the pointer to member. So, in the preceding example, the result of the expression `ADerived.*pmfnFunc1()` is a pointer to a function that returns void. This result is an l-value if the second operand is an l-value.
119+
The result of the **`.*`** or **`->*`** pointer-to-member operators is an object or function of the type specified in the declaration of the pointer to member. So, in the preceding example, the result of the expression `ADerived.*pmfnFunc1()` is a pointer to a function that returns `void`. This result is an l-value if the second operand is an l-value.
120120
121121
> [!NOTE]
122122
> If the result of one of the pointer-to-member operators is a function, then the result can be used only as an operand to the function call operator.
123123
124124
## See also
125125
126-
[C++ Built-in Operators, Precedence and Associativity](../cpp/cpp-built-in-operators-precedence-and-associativity.md)
126+
[C++ built-in operators, precedence, and associativity](../cpp/cpp-built-in-operators-precedence-and-associativity.md)
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
ms.date: 12/06/2021
3+
ms.custom: vs-get-started
4+
ms.topic: include
5+
---
6+
::: moniker range=">=msvc-160"
7+
8+
## Add Git source control
9+
10+
Now that you've created an app, you might want to add it to a Git repository. We've got you covered. Visual Studio makes that process easy with Git tools you can use directly from the IDE.
11+
12+
> [!TIP]
13+
> Git is the most widely used modern version control system, so whether you're a professional developer or you're learning how to code, Git can be very useful. If you're new to Git, the [https://git-scm.com/](https://git-scm.com/) website is a good place to start. There, you can find cheat sheets, a popular online book, and Git Basics videos.
14+
15+
To associate your code with Git, you start by creating a new Git repository where your code is located. Here's how:
16+
17+
1. In the status bar at the bottom-right corner of Visual Studio, select **Add to Source Control**, and then select **Git**.
18+
19+
:::image type="content" source="../media/vs-2022/git-add-source-control.png" alt-text="Screenshot of the Git source control buttons below the Solution Explorer pane, with the Add to Source Control button highlighted.":::
20+
21+
1. In the **Create a Git repository** dialog box, sign in to GitHub.
22+
23+
:::image type="content" source="../media/vs-2022/git-create-repo.png" alt-text="Screenshot of the Create a Git Repository dialog window where you can sign in to GitHub.":::
24+
25+
The repository name auto-populates based on your folder location. By default, your new repository is private, which means you're the only one who can access it.
26+
27+
> [!TIP]
28+
> Whether your repository is public or private, it's best to have a remote backup of your code stored securely on GitHub. Even if you aren't working with a team, a remote repository makes your code available to you from any computer.
29+
30+
1. Select **Create and Push**.
31+
32+
After you create your repository, you see status details in the status bar.
33+
34+
:::image type="content" source="../media/vs-2022/git-new-private-repo-status-details.png" alt-text="Screenshot of the repo status bar that's below the Solution Explorer pane in Visual Studio.":::
35+
36+
The first icon with the arrows shows how many outgoing/incoming commits are in your current branch. You can use this icon to pull any incoming commits or push any outgoing commits. You can also choose to view these commits first. To do so, select the icon, and then select **View Outgoing/Incoming**.
37+
38+
The second icon with the pencil shows the number of uncommitted changes to your code. You can select this icon to view those changes in the **Git Changes** window.
39+
40+
To learn more about how to use Git with your app, see the [Visual Studio version control documentation](/visualstudio/version-control/).
41+
42+
::: moniker-end

docs/get-started/index.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
### YamlMime:Landing
2+
3+
title: Visual Studio tutorials | C++
4+
summary: Create C++ apps with Visual Studio.
5+
6+
metadata:
7+
title: C++ development with Visual Studio
8+
description: Create C++ apps by using Visual Studio.
9+
ms.custom: vs-acquisition
10+
ms.topic: landing-page
11+
ms.date: 12/06/2021
12+
author: corob-msft
13+
ms.author: corob
14+
manager: markl
15+
ms.prod: visual-cpp
16+
ms.technology: vs-acquisition
17+
dev_langs:
18+
- C++
19+
20+
# linkListType: architecture | concept | deploy | download | get-started | how-to-guide | learn | overview | quickstart | reference | tutorial | whats-new
21+
22+
landingContent:
23+
# Card
24+
- title: Get started
25+
linkLists:
26+
- linkListType: how-to-guide
27+
links:
28+
- text: Install C++ support in Visual Studio
29+
url: ../build/vscpp-step-0-installation.md
30+
- linkListType: get-started
31+
links:
32+
- text: Start a guided tour of Visual Studio
33+
url: /visualstudio/get-started/visual-studio-ide
34+
- linkListType: quickstart
35+
links:
36+
- text: Create a "Hello World" console app
37+
url: ../build/vscpp-step-1-create.md
38+
- text: Build and run your "Hello World" console app
39+
url: ../build/vscpp-step-2-build.md
40+
- linkListType: overview
41+
links:
42+
- text: Learn about the Modern C++ language
43+
url: ../cpp/welcome-back-to-cpp-modern-cpp.md
44+
45+
# Card
46+
- title: Create C and C++ apps in Visual Studio
47+
linkLists:
48+
- linkListType: tutorial
49+
links:
50+
- text: Create a console app
51+
url: tutorial-console-cpp.md
52+
- text: Create a Universal Windows Platform app
53+
url: /windows/uwp/cpp-and-winrt-apis/get-started
54+
- text: Create a Windows Desktop app
55+
url: /windows/desktop/learnwin32/learn-to-program-for-windows
56+
- text: Create a Windows Desktop app with MFC
57+
url: ../mfc/reference/creating-an-mfc-application.md
58+
- text: Create a Windows DLL
59+
url: ../build/walkthrough-creating-and-using-a-dynamic-link-library-cpp.md
60+
- text: Create a static library
61+
url: ../build/walkthrough-creating-and-using-a-static-library-cpp.md
62+
- text: Create a .NET component
63+
url: ../dotnet/walkthrough-compiling-a-cpp-program-that-targets-the-clr-in-visual-studio.md
64+
- text: Create a DirectX game
65+
url: /windows/uwp/gaming/tutorial--create-your-first-uwp-directx-game
66+
67+
# Card
68+
- title: Learn Visual Studio
69+
linkLists:
70+
- linkListType: tutorial
71+
links:
72+
- text: Open code from a repo
73+
url: /visualstudio/get-started/tutorial-open-project-from-repo.md
74+
- text: Write and edit code
75+
url: /visualstudio/get-started/tutorial-editor.md
76+
- text: Compile and build
77+
url: /visualstudio/ide/compiling-and-building-in-visual-studio.md
78+
- text: Debug your C++ code
79+
url: /visualstudio/debugger/quickstart-debug-with-cplusplus
80+
- text: Test your C++ code
81+
url: /visualstudio/test/writing-unit-tests-for-c-cpp
82+
- text: Compile C++ on the command line
83+
url: ../build/walkthrough-compiling-a-native-cpp-program-on-the-command-line.md
84+
- text: Compile C on the command line
85+
url: ../build/walkthrough-compile-a-c-program-on-the-command-line.md
86+
- text: Compile C++/CX on the command line
87+
url: ../build/walkthrough-compiling-a-cpp-cx-program-on-the-command-line.md
88+
- text: Compile C++/CLI on the command line
89+
url: ../build/walkthrough-compiling-a-cpp-cli-program-on-the-command-line.md
Loading
Loading
Loading

docs/get-started/toc.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
items:
2+
- name: Get started with Visual C++
3+
expanded: true
4+
items:
5+
- name: Install C++ support in Visual Studio
6+
href: ../build/vscpp-step-0-installation.md
7+
- name: Visual Studio guided tour
8+
href: /visualstudio/get-started/visual-studio-ide
9+
- name: Create and edit a C++ console app project
10+
href: ../build/vscpp-step-1-create.md
11+
- name: Build and run a C++ console app project
12+
href: ../build/vscpp-step-2-build.md
13+
- name: Welcome to Modern C++
14+
href: ../cpp/welcome-back-to-cpp-modern-cpp.md
15+
- name: Create a console calculator in C++
16+
href: ../get-started/tutorial-console-cpp.md
17+
- name: Create a UWP app
18+
href: /windows/uwp/cpp-and-winrt-apis/get-started
19+
- name: Create a Windows Desktop application
20+
href: /windows/desktop/learnwin32/learn-to-program-for-windows
21+
- name: Create a DirectX game
22+
href: /windows/uwp/gaming/tutorial--create-your-first-uwp-directx-game
23+
- name: Create C and C++ apps in Visual Studio
24+
expanded: false
25+
items:
26+
- name: Create a console app
27+
href: tutorial-console-cpp.md
28+
- name: Create a Universal Windows Platform app
29+
href: /windows/uwp/cpp-and-winrt-apis/get-started
30+
- name: Create a Windows Desktop app
31+
href: /windows/desktop/learnwin32/learn-to-program-for-windows
32+
- name: Create a Windows Desktop app with MFC
33+
href: ../mfc/reference/creating-an-mfc-application.md
34+
- name: Create a Windows DLL
35+
href: ../build/walkthrough-creating-and-using-a-dynamic-link-library-cpp.md
36+
- name: Create a static library
37+
href: ../build/walkthrough-creating-and-using-a-static-library-cpp.md
38+
- name: Create a .NET component
39+
href: ../dotnet/walkthrough-compiling-a-cpp-program-that-targets-the-clr-in-visual-studio.md
40+
- name: Create a DirectX game
41+
href: /windows/uwp/gaming/tutorial--create-your-first-uwp-directx-game
42+
- name: Learn Visual Studio
43+
expanded: false
44+
items:
45+
- name: Open code from a repo
46+
href: /visualstudio/get-started/tutorial-open-project-from-repo.md
47+
- name: Write and edit code
48+
href: /visualstudio/get-started/tutorial-editor.md
49+
- name: Compile and build
50+
href: /visualstudio/ide/compiling-and-building-in-visual-studio.md
51+
- name: Debug your C++ code
52+
href: /visualstudio/debugger/quickstart-debug-with-cplusplus
53+
- name: Test your C++ code
54+
href: /visualstudio/test/writing-unit-tests-for-c-cpp
55+
- name: Compile C++ on the command line
56+
href: ../build/walkthrough-compiling-a-native-cpp-program-on-the-command-line.md
57+
- name: Compile C on the command line
58+
href: ../build/walkthrough-compile-a-c-program-on-the-command-line.md
59+
- name: Compile C++/CX on the command line
60+
href: ../build/walkthrough-compiling-a-cpp-cx-program-on-the-command-line.md
61+
- name: Compile C++/CLI on the command line
62+
href: ../build/walkthrough-compiling-a-cpp-cli-program-on-the-command-line.md

0 commit comments

Comments
 (0)