What is the difference between Strings and Arrays?

Answer

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 intergers (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.

 

Improve Answer Discuss the question "What is the difference between Strings and Arrays?" Watch Question

First answer by ID416291531. Last edit by ID416291531. Question popularity: 42 [recommend question]


Research your answer:

Can you answer other questions about computers and the net?

Answers.com > Wiki Answers > Categories > Technology > Computers > What is the difference between Strings and Arrays?

Our contributors said this page should be displayed for the questions below. (Where do these come from)
If any of these are not a genuine rephrasing of the question, please help out and edit these alternates.
Difference strings arrays?  Difference Strings and Arrays?  A program in C that has arrays?  Difference in strings and arrays?  Difference between strings arrays?  Differnce between strings and arrays?  Difference betwen arrays and strings?  Difference between array and strings?  Difference betwee strings and arrays?  Difference between arrays and strings?  Difference between strings and arrays?  Differences between strings and arrays?  Differences between arrays and strings?  Difference between arrays and linked list?  Diffreence between strings and arrays in c?  Difference between strings and arrays in c?  What is difference between strings and arrays in C?  What are the difference between strings and arrays?  What are the differences between strings and arrays?  27What is the difference between Strings and Arrays?