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 string?

An array is usually made of any data arranged into evenly spaced addresses in memory. In the case of a string, the data is a char. So in essence, a string is an array of chars

What is the Difference between array and structures?

The main differences between an array and a structure are: An Array is a collection of similar data items.An array is deriveddata type.It behave like a built in data type. An

Differences between structure and array?

The primary difference is that an array is a homogeneous datatype, meaning that it can hold data of a single type only (integer, floating-point, character etc.) . A structure

What is the difference between an array and structure?

An array is a collection of related data elements of same type. Structure can have elements of different types. An array is a derived data type. A structure is a programmer-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 difference between pointers and arrays?

A pointer is a variable that may contain a memory address, or NULL (zero). An array is collection of data, usually residing in a contiguous block of memory, where every eleme

What is the difference between stack and array?

stack is derived from linear lists which intern as ordered collection of elements. it has a special feature that insertion and deletion can be done at only one end called Top

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

Difference between vector and array?

The abstraction are the same. However, the array may be of any objects, while a vector, in narrowed definition, each element is a scalar value (e.g, int, float, double, etc),

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 array and record?

The main difference b/w array & record is that the array is a collection of similer type like intger ,real ,real etc, which share a common name like 10 elements of type intege

What is the different between array and File?

An array is a systematic arrangement of objects, usually in rows and columns A computer file is a block of arbitrary information, or resource for storing information, which is
In Science

What is the difference between arrays and structure?

    Struct vs. Array     In the C programming language, a structure may contain MULTIPLE DATA TYPES, also including arrays of those types, and the structure b

What is the difference between array and hash?

The main difference is usage...a hash is an array, of sorts. Speaking of sorts, the comparison between a hash and an array takes on meaning when you compare a "sorted array" a