lect14 Vectors II

# lect14 Vectors II - Upcoming Events Project Check Due Next...

This preview shows pages 1–7. Sign up to view the full content.

Upcoming Events Project Check Due Next Week in Lab Phase I main(), menu() Functions and Reading in File Stub Functions Last Lectures Next Week Project and Evaluations Final Exam Reviews Final Exam Times: Mon 10:00 Class: TBD Mon 11:25 Class: TBD Wed 6:25 Class: TBD Changes: Send email to [email protected]

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Survey Time Survey available at: survey.iit.edu
Vectors A Vector Is a Resizable Array Must Include File <vector> Declaration of Vector Syntax: vector< type > variableName; vector< type > variableName( size ); vector< type > variableName( size , initialValue );

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
#include <iostream> #include <vector> using namespace std; int main() { vector<double> vals1; vector<double> vals2(5); vector<double> vals3(5,100); return(0); }
Using Vectors May Access Data the Same as Arrays Use Square Brackets ( [ ] )

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
#include <iostream> #include <vector> using namespace std; int main() { vector<double> vals1; vector<double> vals2(5); vector<double> vals3(5,100); vals2[0] = 6; cout << vals3[2]; return(0); }
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 13

lect14 Vectors II - Upcoming Events Project Check Due Next...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online