it-ebooks - C++ FAQ Lite
Here you can read online it-ebooks - C++ FAQ Lite full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2016, publisher: iBooker it-ebooks, genre: Politics. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:
Romance novel
Science fiction
Adventure
Detective
Science
History
Home and family
Prose
Art
Politics
Computer
Non-fiction
Religion
Business
Children
Humor
Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.
C++ FAQ Lite: summary, description and annotation
We offer to read an annotation, description, summary or preface (depends on what the author of the book "C++ FAQ Lite" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.
C++ FAQ Lite — read online for free the complete book (whole text) full work
Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "C++ FAQ Lite" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.
Font size:
Interval:
Bookmark:
- [1.1]
- [1.2]
- [1.3]
- [1.4]
- [1.5]
- [1.6] C++-FAQ-Lite != C++-FAQ-Book
The entire C++ FAQ Lite document is Copyright 1991-2000 Marshall P. Cline, Ph.D..
The entire C++ FAQ Lite document is Copyright 1991-2000 Marshall P. Cline, Ph.D.
If all you want to do is quote a small portion of C++ FAQ Lite (such as one or two FAQs) in a larger document, simply attribute the quoted portion with something vaguely similar to, "From Marshall Cline's C++ FAQ Lite document, www.parashift.com/c++-faq-lite/
".
If you want to make a copy of large portions and/or the entire C++ FAQ Lite document for your own personal use, you may do so without restriction (provided, of course, that you don't redistribute the document to others, or allow others to copy the document).
If you want to redistribute large portions and/or the entire C++ FAQ Lite document to others, whether or not for commercial use, you must get permission from the author first (and that permission is normally granted; note however that it's often easier for you to simply tell your recipients about the one-click download option). In any event, all copies you make must retain verbatim and display conspicuously all the following: all copyright notices, the Author section, the Copyright Notice section, the No Warranty section, the C++-FAQ-Lite != C++-FAQ-Book section, and the Copy Permissions section.
If you want more and/or different privileges than are outlined here, please contact me, . I'm a very reasonable man...
C++ FAQ LiteFAQ"From Marshall Cline's C++ FAQ Lite document, www.parashift.com/c++-faq-lite/
"
/C++ FAQ Lite
/C++ FAQ LiteC++-FAQ-Lite != C++-FAQ-Book
/
THIS WORK IS PROVIDED ON AN "AS IS" BASIS. THE AUTHOR PROVIDES NO WARRANTY WHATSOEVER, EITHER EXPRESS OR IMPLIED, REGARDING THE WORK, INCLUDING WARRANTIES WITH RESPECT TO ITS MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE.
- Java is a trademark of Sun Microsystems, Inc. in the United States and other countries.
- All other trademarks are the property of their respective owners.
C++ FAQ LiteC++ FAQ Book C++ FAQClineLomowand GirouAddison-Wesley 500%[3]
- [12.1]
- [12.2]
- [12.3]
#include "Fred.hpp" // Fred void userCode(Fred& x) { x = x; // }
#include "Fred.hpp" // Fred void userCode(Fred& x, Fred& y) { x = y; // &x == &y } int main() { Fred z; userCode(z, z); }
bug
class Wilma { }; class Fred { public: Fred() : p_(new Wilma()) { } Fred(const Fred& f) : p_(new Wilma(*f.p_)) { } ~Fred() { delete p_; } Fred& operator= (const Fred& f) { // delete p_; // Line #1 p_ = new Wilma(*f.p_); // Line #2 return *this; } private: Wilma* p_; };
Fred
*this
f
line #1this->p_
f.p_
line #2*f.p_
Fred
Fred
Fred::operator= (const Fred&)
new Wilma(*f.p_)
Wilma
this->p_
Fred& Fred::operator= (const Fred& f) { if (this == &f) return *this; // // ... return *this; }
FAQnew
Wilma
Fred& Fred::operator= (const Fred& f) { // Wilma* tmp = new Wilma(*f.p_); // delete p_; p_ = tmp; return *this; }
if (this == &f) return *this;
Fred
if
() if
99.9%
- [13.1]
- [13.2]
- [13.3]
- [13.4]
- [13.5]
- [13.6]
operator==
char[]
- [13.7]
operator**
- [13.8]
Matrix
- [13.9]
Matrix
- [13.10]
C/C++
class Fred { public: // ... }; #if 0 // Fred add(Fred, Fred); Fred mul(Fred, Fred); Fred f(Fred a, Fred b, Fred c) { return add(add(mul(a,b), mul(b,c)), mul(c,a)); // ... } #else // Fred operator+ (Fred, Fred); Fred operator* (Fred, Fred); Fred f(Fred a, Fred b, Fred c) { return a*b + b*c + c*a; } #endif
myString + yourString
std::string
myDate++
Date
a * b
Number
a[i]
Array
x = *p
"smart pointer"p
x
class Array { public: int& operator[] (unsigned i); // // ... }; inline int& Array::operator[] (unsigned i) // { // ... }
operator
int main() { Array a; a[3] = 4; // ... }
:
C .
? :
sizeof
C++::
.*
class Array { public: int& elem(unsigned i) { if (i > 99) error(); return data[i]; } private: int data[100]; }; int main() { Array a; a.elem(10) = 42; a.elem(12) += a.elem(13); }
class Array { public: int& operator[] (unsigned i) { if (i > 99) error(); return data[i]; } private: int data[100]; }; int main() { Array a; a[10] = 42; a[12] += a[13]; }
operator==
char[]
C++ std::string
operator**
C++operator**
x ** y
x * (*y)
y
pow(base,exponent)
operator^
Matrix
operator()
operator[]
,operator()
operator[]
operator[]
operator()
class Matrix { public: Matrix(unsigned rows, unsigned cols); double& operator() (unsigned row, unsigned col); double operator() (unsigned row, unsigned col) const; _// ..._ ~Matrix(); // Matrix(const Matrix& m); // Matrix& operator= (const Matrix& m); // // ... private: unsigned rows_, cols_; double* data_; }; inline Matrix::Matrix(unsigned rows, unsigned cols) : rows_ (rows), cols_ (cols), data_ (new double[rows * cols]) { if (rows == 0 || cols == 0) throw BadIndex("Matrix constructor has 0 size"); } inline Matrix::~Matrix() { delete[] data_; } inline double& Matrix::operator() (unsigned row, unsigned col) { if (row >= rows_ || col >= cols_) throw BadIndex("Matrix subscript out of bounds"); return data_[cols_*row + col]; } inline double Matrix::operator() (unsigned row, unsigned col) const { if (row >= rows_ || col >= cols_) throw BadIndex("const Matrix subscript out of bounds"); return data_[cols_*row + col]; }
m(i,j)
Matrix
m
m[i][j]
int main() { Matrix m(10,10); m(5,8) = 106.15; std::cout << m(5,8); // ... }
Matrix
FAQ Matrix Array
operator]
Array
operator[]
Matrixdouble
m[i][j]
[m(i,j)
operator()
[][]
operator()
[][]
[][]
operator()
operator()
[][]
Font size:
Interval:
Bookmark:
Similar books «C++ FAQ Lite»
Look at similar books to C++ FAQ Lite. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.
Discussion, reviews of the book C++ FAQ Lite and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.