Write exactly four lines of code which declare one vector and one string (of any size and value you choose) and print their size to the console using a call to a member function of each variable’s respective class.

I would write a sample but I dont really have much else:

#include <iostream>
 #include <string>
  
  using namespace std;
  
  int main(void)
  {
    string word = ;
     vector<int> Vector

thank you

Hint: what would be a good name for a method that returns the size of an item?
(there are two options for string actually). Put Google to work for you.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.