Thursday 15 March 2012

c++11 - Explain C++ code -


Can I get some help with the explanation of the following code?

  #include & lt; Iostream & gt; Square vector {private: double * elem; // pointer index sz for elements; // Number of Elements Public: Vector (Int S): AMM {New Double [S]}, SAS {S} {} Double & amp; Operator [] (int i) {return elem [i]; } Integer size () {return sz; }};  

I am trying to brush my C ++ knowledge, but this syntax looks very new to me.

More specifically code public .

It may be the new C + + 11 preliminary list that is confusing you, now You can get started with a variable with curly-braces {} . For example:

  int i {42}; Std :: vector & lt; Integer & gt; V {1, 2, 3, 4};  

Everything looks pretty standard pre-C ++ 11

in your code

No comments:

Post a Comment