I want to pass a string array to the function like this int function (string text[])
. But the IntelliSense says that identifier string is undefined . Why can't I pass a string array like usually I do with int arrays ?
Asked
Active
Viewed 2,133 times
0

Sam379
- 271
- 2
- 4
- 13
-
1_IntelliSense_ is not a definitive say on whether your code works or not, what happens if you compile it? – K-ballo Jun 19 '13 at 18:48
-
Do you have `#include
` and `using std::string`? – Mankarse Jun 19 '13 at 18:48 -
Because `int` is a built-in datatype while `string` is a datatype created using built-in types and exposed via the standard library. – legends2k Jun 19 '13 at 19:05
1 Answers
2
Are you using std::string
or just string
? Try adding using std::string
if you don't have it in your code.

austin
- 5,816
- 2
- 32
- 40
-
-
3
-
@Sam379 Don't do `using namespace std`, see why [here](http://stackoverflow.com/questions/1452721/why-is-using-namespace-std-considered-bad-practice). – syb0rg Jun 19 '13 at 18:51
-