What would you like to do?

What is the difference between a string and an array?

already exists.

Would you like to merge this question into it?

already exists as an alternate of this question.

Would you like to make it the primary and merge this question into it?

exists and is an alternate of .

Nothing whatsoever. A string is simply an array of type char.
In some programming languages, such as C, a string is an array of char (or short), terminated with a null \0.
An array is just a fixed size of collection, a container to hold things/objects. If all the elements in the container are characters (of char), then we may call it a string, sometimes a byte array (because each character can be represented as a byte).

An array of 7 different days, it maybe a WEEK, or just the birthdays of 7 dwarfs. Then they are nothing to do with strings.

A data item (or variable) is described as a "string" type when it contains some number of characters. Those characters can usually be anything in the system's accepted list of codes. Most systems use ASCII, so a string can include the letters a-z, A-Z, numbers 0-9, and special characters like ~!@#$%^&*()_+-=[]\{}|:";'<>?,/. A string is treated as a single object, although most programming languages have methods to break strings apart (called sub-stringing). In the Perl language, strings are named $something.
An array is a collection of individual data items, sort of like a list. Each element in an array can be referred to in a program by its position in the list. In the Perl language, an array would be named @SOMETHING. The first element in the array would be named $SOMETHING[0], the second $SOMETHING[1], and so on. Each element can be a string, or some other data type.
Other data types would be integers (positive or negative whole numbers), floating point (decimal numbers like 3.14159 or 2398.41; it can be more complicated than this, but that's another story), and a few more exotic types.
In the C programming language a string is actually the same as an array of characters. The last character in a C string is a zero byte which indicates the end of the string.
+ 18 others found this useful
Thanks for the feedback!

What is the difference between an array and a hash?

An array stores elements in a sequential order from zero (or one) up to the size of the array (possibly minus one, if starting from zero). Arrays come from the classic days of

Difference between arraylist and array?

An array list contains primitive types, while an ArrayList contains objects. However, this does not mean that an ArrayList cannot hold integers. In fact, through auto-boxing,

Difference between loop and array?

    A loop usually referred to the program flow control with possible repetition of executing the same codes, an array is an abstraction of fixed size container.  2 d

What is the difference between array and array list?

In VB.net, an Array has a defined count, whereas an ArrayList can be populated dynamically. You can perform advanced calculations on an Array, making it more powerful, but it

What is the difference between an array and variable?

Traditional wisdom would say that an array holds multiple values, whereas an ordinary variable hold a single value. While this is not false per se, it is only really true in

What is the difference between an array and a variable?

Variables such as int, char, and float are simply one number/character. And array is a collection of variables, sort of like what would be called a string in another programin

What are differences between broadside array and end fire array?

end fire array A combination of identical and equally spaced antenna that radiate along the axis of the axis of the antenna array is known as an end fire array. the elemen

Difference between array and structure?

Array:- " Array is anordered collection of homogenous types of data elements". hence it means data is stored at continous memory location. e.g:- int or float or char etc. St

Different between array and variables?

  An array is a collection of variables of the same type. For example: int x[10]; defines 10 integer variables at consecutive memory locations starting with x[0] and e

What is the difference between array and control array?

An array is a set of values that are logically related to each other, such as the number of students in each grade in a grammar school. An array allows you to refer to these r

What is the difference between null array and an empty array?

There is no null array as such. However, a pointer to an array may be nullified (pointing to zero) before memory is allocated to it, or after that memory is released. But the