Created
July 10, 2013 05:59
-
-
Save satojkovic/5963777 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <vector> | |
#include <iostream> | |
#include <string> | |
using namespace std; | |
void Empty(string str, vector<int> v) | |
{ | |
if( v.empty() ) { | |
cout << str << " is empty" << endl; | |
} | |
else { | |
cout << str << " is not empty" << endl; | |
} | |
} | |
void Show(vector<int> v) | |
{ | |
for(unsigned int i=0; i<v.size(); i++) { | |
cout << "(" << i << "): " << v[i] << endl; | |
} | |
} | |
int main() | |
{ | |
vector<int> v1; | |
vector<int> v2; | |
v2.push_back(0); | |
v2.push_back(0); | |
v2.push_back(0); | |
Empty("v1", v1); Show(v1); | |
Empty("v2", v2); Show(v2); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment