--- title: "Adding a Member Function (Visual C++) | Microsoft Docs" ms.custom: "" ms.date: "11/04/2016" ms.reviewer: "" ms.suite: "" ms.technology: - "cpp-ide" ms.tgt_pltfrm: "" ms.topic: "article" f1_keywords: - "vc.codewiz.classes.member.function" dev_langs: - "C++" helpviewer_keywords: - "member functions, adding to classes" - "classes [C++], adding members" ms.assetid: 55b25ddb-541d-44ed-957c-974ef91cfc85 caps.latest.revision: 7 author: "mikeblome" ms.author: "mblome" manager: "ghogen" translation.priority.ht: - "cs-cz" - "de-de" - "es-es" - "fr-fr" - "it-it" - "ja-jp" - "ko-kr" - "pl-pl" - "pt-br" - "ru-ru" - "tr-tr" - "zh-cn" - "zh-tw" --- # Adding a Member Function (Visual C++) In **Class View**, you can add a member function to any class. When you do this, a declaration is added to the header file, and a stub member-function body is added to the class's implementation file, which you can then modify. ### To add a member function to a class 1. In **Class View**, expand the project node to display the classes in the project. (To open **Class View**, on the menu bar, choose **View**, **Class View**.) 2. Open the shortcut menu for the class you want to add a member function to, and then choose **Add**, **Add Function**. 3. Provide the appropriate details about the member function. For more information, see [Add Member Function Wizard](../ide/add-member-function-wizard.md). 4. Choose the **Finish** button to generate the member function code. ## See Also [Adding Functionality with Code Wizards](../ide/adding-functionality-with-code-wizards-cpp.md) [Adding a Class](../ide/adding-a-class-visual-cpp.md) [Adding a Member Variable](../ide/adding-a-member-variable-visual-cpp.md) [Overriding a Virtual Function](../ide/overriding-a-virtual-function-visual-cpp.md) [MFC Message Handler](../mfc/reference/adding-an-mfc-message-handler.md) [Navigating the Class Structure](../ide/navigating-the-class-structure-visual-cpp.md)