Array and pointers

What is meaning of this
char *a= new char[10]

It allocates an array of 10 characters and variable a stores the address of first character of the array.

Is this array will be a global means can access also from main() or this array destroy when function get over

If you declare it outside the main() it will be a global array if you declare it inside main() then this array will get destroyed when function is over or can say executed.

In the lecture of string tokinizer 2 at 17:00 sir used char array from main and it work also but it should be destroyed after returning a value

Hey Mayur, you are getting it wrong, charptr is declared in main() and we are calling mystrok() from main() only so charptr will not be destroyed until the main() is fully executed till the end.