vinay singh C++

 

Embed or link this publication

Description

vinay singh

Popular Pages


p. 1



[close]

p. 2

c the complete reference third edition

[close]

p. 3

about the author herb schildt is the leading authority on c and c and a best-selling author whose books have sold more than 1.5 million copies his acclaimed c and c books include teach yourself c c from the ground up teach yourself c c the complete reference borland c the complete reference and c programmer s reference to name a few.

[close]

p. 4

c the complete reference third edition herbert schildt osborne mcgraw-hill berkeley new york st louis san francisco auckland bogotá hamburg london madrid mexico city milan montreal new delhi panama city paris são paulo singapore sydney tokyo toronto

[close]

p. 5

mcgraw-hill abc copyright © 1998 by mcgraw-hill companies all rights reserved manufactured in the united states of america except as permitted under the united states copyright act of 1976 no part of this publication may be reproduced or distributed in any form or by any means or stored in a database or retrieval system without the prior written permission of the publisher 0-07-213293-0 the material in this ebook also appears in the print version of this title 0-07-882476-1 all trademarks are trademarks of their respective owners rather than put a trademark symbol after every occurrence of a trademarked name we use names in an editorial fashion only and to the benefit of the trademark owner with no intention of infringement of the trademark where such designations appear in this book they have been printed with initial caps mcgraw-hill ebooks are available at special quantity discounts to use as premiums and sales promotions or for use in corporate training programs for more information please contact george hoare special sales at george_hoare@mcgraw-hill.com or 212 9044069 terms of use this is a copyrighted work and the mcgraw-hill companies inc mcgraw-hill and its licensors reserve all rights in and to the work use of this work is subject to these terms except as permitted under the copyright act of 1976 and the right to store and retrieve one copy of the work you may not decompile disassemble reverse engineer reproduce modify create derivative works based upon transmit distribute disseminate sell publish or sublicense the work or any part of it without mcgraw-hill s prior consent you may use the work for your own noncommercial and personal use any other use of the work is strictly prohibited your right to use the work may be terminated if you fail to comply with these terms the work is provided as is mcgraw-hill and its licensors make no guarantees or warranties as to the accuracy adequacy or completeness of or results to be obtained from using the work including any information that can be accessed through the work via hyperlink or otherwise and expressly disclaim any warranty express or implied including but not limited to implied warranties of merchantability or fitness for a particular purpose mcgraw-hill and its licensors do not warrant or guarantee that the functions contained in the work will meet your requirements or that its operation will be uninterrupted or error free neither mcgraw-hill nor its licensors shall be liable to you or anyone else for any inaccuracy error or omission regardless of cause in the work or for any damages resulting therefrom mcgraw-hill has no responsibility for the content of any information accessed through the work under no circumstances shall mcgraw-hill and/or its licensors be liable for any indirect incidental special punitive consequential or similar damages that result from the use of or inability to use the work even if any of them has been advised of the possibility of such damages this limitation of liability shall apply to any claim or cause whatsoever whether such claim or cause arises in contract tort or otherwise doi 10.1036/0072132930

[close]

p. 6

contents at a glance part i the foundation of c the c subset an overview of c expressions statements arrays and null-terminated strings pointers functions structures unions enumerations and userdefined types 8 c-style console i/o 9 file i/o 10 the preprocessor and comments 1 2 3 4 5 6 7 part ii c 11 an overview of c 12 classes and objects 13 arrays pointers references and the dynamic allocation operators 14 function overloading copy constructors and default arguments 15 operator overloading 255 289 327 361 385 3 13 57 89 113 137 161 187 211 237 v

[close]

p. 7

vi c the complete reference inheritance virtual functions and polymorphism templates exception handling c i/o system basics c file i/o run-time type id and the casting operators namespaces conversion functions,and other advanced topics 24 introducing the standard template library 16 17 18 19 20 21 22 23 part iii the standard function library 25 26 27 28 29 30 31 the c-based i/o functions the string and character functions the mathematical functions time date and localization functions the dynamic allocation functions utility functions the wide-character functions 419 445 461 489 511 541 569 593 625 695 719 733 743 753 757 771 part iv the standard c class library 32 33 34 35 36 37 38 the standard c i/o classes the stl container classes the stl algorithms stl iterators allocators and function objects the string class the numeric classes exception handling and miscellaneous classes 783 807 835 857 877 893 921 part v applying c 39 integrating new classes a custom string class 40 an object-oriented expression parser index 931 959 995

[close]

p. 8

contents preface xxix part i the foundation of c the c subset 1 an overview of c the origins of c c is a middle-level language c is a structured language c is a programmer s language the form of a c program the library and linking separate compilation understanding the .c and .cpp file extensions 3 4 4 6 8 9 10 12 12 2 expressions the five basic data types 13 14 vii

[close]

p. 9

viii c the complete reference modifying the basic types identifier names variables where variables are declared local variables formal parameters global variables access modifiers const volatile storage class specifiers extern static variables register variables variable initializations constants hexadecimal and octal constants string constants backslash character constants operators the assignment operator type conversion in assignments multiple assignments arithmetic operators increment and decrement relational and logical operators bitwise operators the operator the and pointer operators the compile-time operator sizeof the comma operator the dot and arrow operators the and operators precedence summary expressions order of evaluation type conversion in expressions casts spacing and parentheses shorthand assignments 15 16 17 17 17 21 21 23 23 24 25 25 27 29 31 31 32 33 33 34 34 35 36 37 37 39 42 47 47 49 50 51 51 52 53 53 53 54 55 56 3 statements true and false in c and c 57 58

[close]

p. 10

contents ix selection statements if nested ifs the if-else-if ladder the alternative the conditional expression switch nested switch statements iteration statements the for loop for loop variations the infinite loop for loops with no bodies the while loop the do-while loop declaring variables within selection and iteration statements jump statements the return statement the goto statement the break statement the exit function the continue statement expression statements block statements 59 59 60 62 63 66 67 70 70 70 72 76 77 77 79 81 82 82 83 83 85 86 88 88 4 arrays and null-terminated strings single-dimension arrays generating a pointer to an array passing single-dimension arrays to functions null-terminated strings two-dimensional arrays arrays of strings multidimensional arrays indexing pointers array initialization unsized array initializations a tic-tac-toe example 89 90 92 92 94 96 100 101 102 105 106 108 5 pointers what are pointers pointer variables the pointer operators pointer expressions 113 114 115 115 116

[close]

p. 11

x c the complete reference pointer assignments pointer arithmetic pointer comparisons pointers and arrays arrays of pointers multiple indirection initializing pointers pointers to functions c s dynamic allocation functions problems with pointers 117 117 119 120 122 123 124 126 129 131 6 functions the general form of a function scope rules of functions function arguments call by value call by reference creating a call by reference calling functions with arrays argc and argv arguments to main the return statement returning from a function returning values returning pointers functions of type void what does main return recursion function prototypes standard library function prototypes declaring variable-length parameter lists old-style versus modern function parameter declarations implementation issues parameters and general-purpose functions efficiency 137 138 138 139 139 140 142 144 147 147 149 151 152 153 153 155 157 158 158 159 159 159 7 structures unions enumerations and userdefined types structures accessing structure members structure assignments arrays of structures passing structures to functions passing structure members to functions passing entire structures to functions 161 162 165 165 166 166 167 167

[close]

p. 12

contents xi structure pointers declaring a structure pointer using structure pointers arrays and structures within structures bit-fields unions enumerations using sizeof to ensure portability typedef 169 170 170 173 174 176 180 183 184 8 c-style console i/o an important application note reading and writing characters a problem with getchar alternatives to getchar reading and writing strings formatted console i/o printf printing characters printing numbers displaying an address the %n specifier format modifiers the minimum field width specifier the precision specifier justifying output handling other data types the and modifiers scanf format specifiers inputting numbers inputting unsigned integers reading individual characters using scanf reading strings inputting an address the %n specifier using a scanset discarding unwanted white space non-white-space characters in the control string you must pass scanf addresses format modifiers suppressing input 187 188 189 190 190 192 195 195 196 196 198 198 199 199 200 201 202 202 203 203 203 205 205 205 206 206 206 207 208 208 208 209

[close]

p. 13

xii c the complete reference 9 file i/o c versus c file i/o streams and files streams text streams binary streams files file system basics the file pointer opening a file closing a file writing a character reading a character using fopen getc putc and fclose using feof working with strings fputs and fgets rewind ferror erasing files flushing a stream fread and fwrite using fread and fwrite fseek and random-access i/o fprintf and fscanf the standard streams the console i/o connection using freopen to redirect the standard streams 211 212 212 212 213 213 213 214 215 215 217 218 218 218 220 222 223 224 226 227 227 228 229 231 232 234 235 10 the preprocessor and comments the preprocessor #define defining function-like macros #error #include conditional compilation directives #if #else #elif and #endif #ifdef and #ifndef #undef using defined #line #pragma the and preprocessor operators predefined macro names 237 238 238 240 241 242 242 243 245 246 247 248 248 248 250

[close]

p. 14

contents xiii c-style comments part ii c 250 11 an overview of c the origins of c what is object-oriented programming encapsulation polymorphism inheritance some c fundamentals a sample c program a closer look at the i/o operators declaring local variables no default to int the bool data type old-style vs modern c the new c headers namespaces working with an old compiler introducing c classes function overloading operator overloading inheritance constructors and destructors the c keywords the general form of a c program 255 256 257 258 258 259 259 260 263 264 265 266 266 268 269 270 270 274 278 278 283 287 288 12 classes and objects classes structures and classes are related unions and classes are related anonymous unions friend functions friend classes inline functions defining inline functions within a class parameterized constructors constructors with one parameter a special case static class members static data members 289 290 293 295 297 298 302 303 306 307 309 310 310

[close]

p. 15

xiv c the complete reference static member functions when constructors and destructors are executed the scope resolution operator nested classes local classes passing objects to functions returning objects object assignment 315 317 319 320 320 321 323 324 13 arrays pointers references and the dynamic allocation operators 327 arrays of objects creating initialized vs uninitialized arrays pointers to objects type checking c pointers the this pointer pointers to derived types pointers to class members references reference parameters passing references to objects returning references independent references references to derived types restrictions to references a matter of style c s dynamic allocation operators initializing allocated memory allocating arrays allocating objects the nothrow alternative the placement forms of new and delete 328 330 331 333 334 336 339 341 341 345 346 347 348 349 349 349 351 352 353 358 359 14 function overloading copy constructors and default arguments function overloading overloading constructor functions overloading a constructor to gain flexibility allowing both initialized and uninitialized objects copy constructors finding the address of an overloaded function the overload anachronism 361 362 364 364 366 368 372 373

[close]

Comments

no comments yet

YOUBLISHER
About
What Others Say
Sitemap
Impressum

PUBLISHERS
Login
Signup
Tutorials
FAQ
Support

BUSINESS
Overview
Advertising
Support

DEVELOPERS
API

LEGAL
Report a Copyright Violation
Copyright FAQ
Terms of Use
Privacy Policy