I wanted to have a vector<string> and a vector<double> in my class so I used forward declarations below:
template <typename T> class vector;
But I recieve the error: field 'varname' has incomplete type for both vector<string> and vector<double> variables.
I searched internet for this error but all the things I found was problems with user written classes not STLs'.
Well that has some problems too.When I include vector and string instead of making forward declarations,I recieve following errors:
explicit Term(const string&);
const Term derive(const string&);
/*error1:expected ',' or '...' before '&' token
error2:ISO C++ forbids declaration of 'string' with no type*/
/*error1:ISO C++ forbids declaration of 'vector' with no type
error2:expected ';' before '<' token*/
If you're creating your own vector template class, then the forward declaration is:
template <class T> class vector;
And depending on your compiler, the entire source for the template class may need to be included into the same file (specifically, you may not be able to separate the prototype into a vector.h file and the implementation into a vector.cpp file).
Unless you're also writing your own string class, then you have to include it -- it's not part of the C++ language, it's a class written in C++:
using namespace std;
Hi. I have a form with list box : lst_product, datagridview : grd_order and button: btn_addline. lst_product has a list of product ids selected from database (MS Acess 2013) , grd_order is by default empty except for 2 headers and btn_addline adds rows to grd_order.
I am writing a java program that needs to execute shell commands, so I wrote a function that would take the command to execute as a string (ie: "mkdir ~/Folder1") and execute that command with the shell. Here is the function:
Runtime run = Runtime.getRuntime();
Process pr = ...
Hey, so I wanna ask how I need to create a method who will remove word if in that word is 2 same chars. Example: "Potato" in this word there is a 2 "o" chars so this word will need to be removed. "Forum" in this word there is no ...