answersLogoWhite

0

What are array of string pointers?

Updated: 8/19/2019
User Avatar

Wiki User

13y ago

Best Answer

An array of pointers to string would contain, per array position, a number dictating which memory address holds the string data.

For example, position [0] in an array would contain a memory address. This memory address can be de-referenced to obtain the actual information held within that memory address.

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What are array of string pointers?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is an array pointers?

I guess it is an 'array of pointers'. Example:int main (int argc, char *argv[])


How do you store a string of letters for example abcdeabcde each to an array?

In C programming you would use the following: char a[] = "abcdeabcde"; If you wish to create an array with more than one string, use an array of character pointers instead: char* a[] = {"abcde", "fgh", "ijklm", "nopq", "rstu", "vwxyz"};


How do you use bsearch function to search a name sorted in array of pointers to string?

solution of above question on (link moved to link section)


How do you use string in bubble sort in c plus plus code?

Do you mean how do you sort strings using bubble sort? void exch( std::string& a, std::string& b) { std::string tmp = a; a = b; b = tmp; } void bubble_sort( std::string A[], size_t size ) { size_t last_exch, left, right; while( size ) { for( left=0, right=1, last_exch=left; right<size; ++left, ++right) if( A[right]<A[left] ) exch( A[left], A[last_exch=right] ); size = last_exch; } } Clearly this is inefficient. A better approach would be to use an array of pointers to strings, and swap the pointers instead. The same can be said of any array of objects: use an array of pointers to the objects, never store the objects themselves in the array that is to be sorted.


What is Arrays of Pointers?

An array of pointers is a contiguous block of memory that contains pointers to other memory locations. They essentially allow non-contiguous memory locations to be treated as if they were an actual array.


Why array is a implicit pointer?

An array of pointers is exactly what it sounds like - one or more pointers arranged in order in memory, accessible through a common base name and indexed as needed. Philosophically, there is no difference between an array of pointers and an array of objects...int a[10]; // 10 integers, named a[0], a[1], a[2], ..., a[9]int *b[10]; // 10 pointers to int, named b[0], b[1], b[2], ..., b[9]If you initialize the array of pointers...int i;for (i = 0; i < 10; i++) b[i] = &a[i];... then *b[0] would be the same as a[0], etc.


What is the array of string in c?

A string in C is stored in a 1 dimension array so an array of strings is simply a two dimension array.


How many constructors are there for the string class?

The String class has multiple Constructors. Some of them are: 1. String - new String(String val) 2. Character Array - new String(char[] array) 3. Character Array with index positions - new String(char[] array. int start, int end)


How do you convert a string into a character array?

A string is, by definition, a character array. No conversion is required.


What is array of string?

An array of strings is usually implemented as an array of character pointers. Each pointer refers to a a null-terminated character array, and can be treated just as if it were a two-dimensional array where the length of each "row" is not fixed length (the null terminator marks the end of each row). The array of character pointers must be allocated in contiguous memory (as must all one-dimensional arrays), however the character arrays they point to need not be allocated contiguously with each other (only the individual one-dimensional character arrays must be contiguous).


What elements are in string?

A string is an array of characters.


What is the difference between array and string of array?

When we declare an array of characters it has to be terminated by the NULL , but termination by NULL in case of string is automatic.