- #1
Medicol
- 223
- 54
1. Using new to create a memory block for a static array of strings. How to know the number of strings in an array of strings
new
1. static char ** array=new char*[]; // why the empty [] ? Will I get a minus point if coding like this ? My teacher says subscript data should be known in advance
.
2. If I have a library function that has the signature
I am using it like this
I then would like to know the number of strings returned from that function.
I am taking the first course in IT programming, I chose C++ language.
Homework Equations
new
The Attempt at a Solution
1. static char ** array=new char*[]; // why the empty [] ? Will I get a minus point if coding like this ? My teacher says subscript data should be known in advance
.
2. If I have a library function that has the signature
PHP:
char** doSomething(...);
I am using it like this
PHP:
char**ret=doSomething();
I then would like to know the number of strings returned from that function.
I am taking the first course in IT programming, I chose C++ language.