1 / 24

C++: A General Purpose Language and Library

C++: A General Purpose Language and Library. Kate Gregory | Gregory Consulting James McNellis | Senior Engineer, Visual C++. Meet Kate Gregory | ‏@ gregcons. Consultant (mentor), author, developer All about community MVP, RD, user groups, conferences StackOverflow

Download Presentation

C++: A General Purpose Language and Library

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. C++: A General Purpose Language and Library Kate Gregory | Gregory Consulting James McNellis| Senior Engineer, Visual C++

  2. Meet Kate Gregory | ‏@gregcons • Consultant (mentor), author, developer • All about community • MVP, RD, user groups, conferences • StackOverflow • Twitter, blog, Facebook… • Over 35 years of industry experience • Using C++ since before Microsoft had a C++ compiler

  3. Meet James McNellis | @JamesMcNellis • Senior Software Development Engineer at Microsoft • Currently a member of the Visual C++ Libraries team • One of the top C++ contributors on StackOverflow • Using C++ since Microsoft released Visual C++ 6.0 • Usually has absolutely no idea what he is doing

  4. Course Topics

  5. Setting Expectations • Target Audience • Has done some development in any other programming language • Familiar with concepts like looping, conditional expressions • No need for any C++ background or any C-related language • Suggested Prerequisites/Supporting Material • Book: C++ Primer, 5th Ed., by Lippman, Lajoie, and Moo • Software and Tools • Microsoft Visual Studio Express 2013 for Windows Desktop • Free download • Sample Code available • http://aka.ms/CodeCPlusPlusJS

  6. Join the MVA Community! • Microsoft Virtual Academy • Free online learning tailored for IT Pros and Developers • Over 1M registered users • Up-to-date, relevant training on variety of Microsoft products • “Earn while you learn!” • Get 50 MVA Points for this event! • Visit http://aka.ms/MVA-Voucher • Enter this code: CPlusPlus (expires 12/20/2013)

  7. 01 | {Getting Started} Kate Gregory | Gregory Consulting James McNellis | Senior Engineer, Visual C++

  8. Module Overview • Development Environment • How to write, build, and run code • Quick History of C++ • Variables and Types

  9. Lesson 1 – Development Environment • Development Environment

  10. Development Environment • Visual Studio Express 2013 for Windows Desktop • It’s free and it’s all you need to follow along • Not using Windows? • C++ works on other platforms too • http://isocpp.org/get-started has links to compilers • Our sample code is available • LINK TBA

  11. Hello, World!

  12. Lesson 2: How to Write, Build and Run Code • How code is built • Structure of a C++ program • Debugging

  13. The Compilation Process

  14. Structure of a C++ program #include <iostream> int main() { std::cout << "Hello, World!" << std::endl; return 0; } Use a library Special function name that the OS calls to run your program std::cout represents console output<< means send the next thing to it

  15. Building

  16. Debugging • Normally a console application • Starts • Executes the code in main() • Might print to the console (or read from the keyboard) • Terminates (quits) • Under a debugger, you can pause execution • Inspect values • Watch execution proceed • Slower, but vital to understanding

  17. Debugging

  18. Lesson 3: Quick History of C++ • Born in 1979 as C with Classes • Retains backward compatibility with C • Named C++ in 1983 • Ratified as ISO standard in 1998 • Continues to change under stewardship of a standards committee

  19. Lesson 1: Types • C++ is strongly typed • Fundamental types • Casting (changing type)

  20. Types

  21. Fundamental Types • Types you use a lot: • int, unsigned int • double • bool • Types you may see • char, unsigned char • long, unsigned long • short, unsigned short • float • http://msdn.microsoft.com/en-us/library/cc953fe1.aspx

  22. Casting • Instead of writing code that relies on the compiler to convert one type to another, you can ask for it explicitly • i = static_cast<int>(3.2); • Makes a good “signpost” for others who read your code • Takes away compiler warnings • Always try to build warning free

  23. Casting

More Related