const char arr[]="Hello There";
I am trying to create a character array as above.
Below, is the code which I use. Is this a correct way to create a char array.
-(void) createCharArray:(NSString*) text{
char arr[text.length];
for(int i=0;i<text.length;i++){
arr[i]=[text characterAtIndex:i];
}
}
Do we have to worry about null termination? Do we have any other way to achieve the same?