answersLogoWhite

0

string, vector and array do not have a common base class. Overload your function to accept either a string, a vector or an array.

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

Rearrange the string in alphabetical order in two dimensional character array?

Use a std::vector<std::string>> to store the strings, then call the std::vector::sort() method.


How do you implement vector?

import java.util.Vector; public class VectorTest { /** * @param args */ public static void main(String[] args) { //instantiating a vector Vector vct = new Vector(); //Add objects to a vector vct.add("One"); //getting values from the vector String val = (String) vct.get(0); //vector size System.out.println("Vector size is: " + vct.size()); //removing elements from a vector vct.remove(0); } }


When drawing a vector using the triangle method of addition how do you draw in the resultant vector?

When drawing a vector using the triangle method you will draw in the resultant vector using Pythagorean theorem. This is taught in physics.


What is inventory displayer c plus plus?

// Inventory Displayer // Demonstrates constant references #include <iostream> #include <string> #include <vector> using namespace std; //parameter vec is a constant reference to a vector of strings void display(const vector<string>& vec); int main() { vector<string> inventory; inventory.push_back( "sword"); inventory.push_back( "armor"); inventory.push_back( "shield"); display(inventory); return 0; } //parameter vec is a constant reference to a vector of strings void display(const vector<string>& vec) { cout << "Your items:\n"; for (vector<string>::const_iterator iter = vec.begin(); iter != vec.end(); ++iter) { cout << *iter << endl; } }


Can vector store string values in java programming?

A Vector can store any objects, so yes.


How will you get the third vector if the 1st and 2nd vector was given and the resultant vector is equal to 0?

by method of finding resultant


When solving vector addition problem you can either the graphical method or the?

analytical method.


Where is the second vector's tail placed when two vectors are added graphically using the tip to tail method?

it is placed at the tip of the first vector


Can you give me examples of parallelogram and polygon method of representing vectors?

The parallelogram method involves placing two vectors such that they originate from the same point, forming a parallelogram, and the resultant vector is represented by the diagonal of this shape. For the polygon method, vectors are arranged in sequence, where the tail of one vector is placed at the head of the previous vector, and the resultant vector is drawn from the start of the first vector to the end of the last vector. Both methods visually depict how vectors combine to form a resultant vector.


What is the vector sum of 7 and 5 and 13 and -5?

The whole point of a vector is that it has a magnitude and a direction. There are no directions given in the above string of numbers.


When solving vector addition problems you can use either the graphical method or the .?

analytical method.


When solving a vector addition problems you can use either the graphical method or?

analytical method.