cs Sept 26, 2014
review of quiz 2
1. array of 5 vectors (int) with empty elements.
vector of 5 int elements each initialized to value zero.
2. requirement for aray/vector . memory allocated must be contiugous.. no space between elements.
a + b == c + d // all are r-values as nothing is modified..
1.assignment and cin >> x (input value
2.assignment statement
3.for (auto x: a)
the above 3 are l-values.
5. const in n; can only initially constants can't give assign them later on.
constexpr int m = x; // not allowed. clear value must be known at compile time..
const int m = x ; // allowed
how to sort two vectors in parallel
vector<string> n1 = n;
vector<double = a
sort(n.begin(), n.end())
search for n[0] in n1
use that index to find a1[i] in a2
1. mptopdf name_pairs.mp
2. src2latex lab2.cpp
3. pdflatex lab2.cpp.tex

0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home