Introduccion A La Programacion Para Videojuegos
e-Institute Publishing, Inc.
1
©Copyright 2004 e-Institute, Inc. All rights reserved. No part of this book may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system without prior written permission from e-Institute Inc., except for theinclusion of brief quotations in a review.
Editor: Susan Nguyen Cover Design: Adam Hoult
E-INSTITUTE PUBLISHING INC www.gameinstitute.com
Frank Luna, Game Institute Faculty, C++ Programming for Games
All brand names and product names mentioned in this book are trademarks or service marks of their respective companies. Any omission or misuse of any kind of service marks or trademarksshould not be regarded as intent to infringe on the property of others. The publisher recognizes and respects all marks used by companies, manufacturers, and developers as a means to distinguish their products.
E-INSTITUTE PUBLISHING titles are available for site license or bulk purchase by institutions, user groups, corporations, etc. For additional information, please contact the SalesDepartment at sales@gameinstitute.com
2
Table of Contents
CHAPTER 1: INTRODUCING C++.......................................................................................................................................9 INTRODUCTION......................................................................................................................................................................10 CHAPTER OBJECTIVES ...........................................................................................................................................................10 1.1 GETTING STARTED—YOUR FIRST C++ PROGRAM ..........................................................................................................10 1.1.1 Creating theProject................................................................................................................................................10 1.1.2 Adding A .CPP File to the Project ..........................................................................................................................12 1.1.3 Writing the Code.....................................................................................................................................................13 1.1.4 Compiling, Linking, and Executing.........................................................................................................................14 1.2 THE “PRINT STRING” PROGRAM EXPLAINED ...................................................................................................................16 1.2.1Comments................................................................................................................................................................16 1.2.2 White Space.............................................................................................................................................................17 1.2.2 Include Directives...................................................................................................................................................18 1.2.3 Namespaces.............................................................................................................................................................18 1.2.4 The main{...}Function.....................................................................................................................................20 1.2.5 std::string ................................................................................................................................................................20 1.2.6 Input and Output with std::cin and std::cout ............................................................................................20 1.3 VARIABLES...
Regístrate para leer el documento completo.