UrbanPro

Learn C Language from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

What is the difference between a string and an array?

Asked by Last Modified  

Follow 2
Answer

Please enter your answer

An array is an array of anything. A string is a specific kind of an array with a well-known convention to determine its length. There are two kinds of programming languages: those in which a string is just an array of characters, and those in which its a special type. In C, a string is just an array...
read more
An array is an array of anything. A string is a specific kind of an array with a well-known convention to determine its length. There are two kinds of programming languages: those in which a string is just an array of characters, and those in which its a special type. In C, a string is just an array of characters (type char), with one wrinkle: a C string always ends with a NUL character. The value of an array is the same as the address of (or a pointer to) the first element; so, frequently, a C string and a pointer to char are used to mean the same thing. An array can be any length. If its passed to a function, theres no way the function can tell how long the array is supposed to be, unless some convention is used. The convention for strings is NUL termination; the last character is an ASCII NUL () character. read less
Comments

Professional Tutor with 15 years of experience.

String is array of characters terminated with null.
Comments

Thanks for the question Rakes, String is just a character array which can hold only character type data whereas array is a collection of similar types of element and the type can be any data type. Thank You, Team DishaaPro
Comments

Java Trainer

1)Array support to store all similar data types like int array,char array,float array and double array,but where as string array can support any characters like char array.2)In String array '\0' supply at last but in normal array it cont.
Comments

Technology expert

Array works for group of integer or float numbers.String works for group of characters.so.String are called as character array.
Comments

Home Tutor for Maths and Science

- String can hold only char data. Where as an array can hold any data type. - An array size can not be changed. Where as a string size can be changed if it is a char pointer - The last element of an array is an element of the specific type. The last character of a string is a null -- ‘\0’ character. -...
read more
- String can hold only char data. Where as an array can hold any data type. - An array size can not be changed. Where as a string size can be changed if it is a char pointer - The last element of an array is an element of the specific type. The last character of a string is a null – ‘\0’ character. - The length of an array is to specified in [ ] at the time of declaration (except char[]). The length of the string is the number of characters + one (null character). read less
Comments

Doing mathematics & computing from IIT Delhi

String is a type of array that store characters. But an array can store integers, float, characters etc. We do not need to define the size of a string but in case of arrays, we need to.
Comments

COMPUTER GEEK

An array is an array of anything. A string is a specific kind of an array with a well-known convention to determine its length.
Comments

Having 2 years of teaching experience

The following are the differences: 1. String can hold only char data. Where as an array can hold any data type. 2. An array size can not be changed. Where as a string size can be changed if it is a char pointer 3. The last element of an array is an element of the specific type. The last character...
read more
The following are the differences: 1. String can hold only char data. Where as an array can hold any data type. 2. An array size can not be changed. Where as a string size can be changed if it is a char pointer 3. The last element of an array is an element of the specific type. The last character of a string is a null – ‘\0’ character. 4. The length of an array is to specified in [] at the time of declaration (except char[]). The length of the string is the number of characters + one (null character). read less
Comments

C and linux Expert

Strings are similar to arrays with just a few differences. Usually, the array size is fixed, while strings can have a variable number of elements. Arrays can contain any data type (char short int even other arrays) while strings are usually ASCII characters terminated with a NULL (0) character.
Comments

View 35 more Answers

Related Questions

What is the fee for learning C Language?
In C lang course ,there is not only basics it also having whole package to complete the task and course.cost may be it's depends upon the institute n teaching level
Sk.
Which are the best books to learn C?
- Yashwant Kanetkar - E Balagurusamy
Kratika
Can we have if inside else-if or else in C programming language?
Yes it is possible to do so. The if... else if..... else statements support one other inside themselves... so...
Kirthi
What is a calling function in C?
Calling function is the one where the function call has been made and after executing the called function, control returns to the calling function.
Gowre
0 0
5

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons

C Language
To get help in C window (for keywords, functions) press Alt +F1.To delete a single line , use the shortcut key CTRL +Y.If you got error about the path when you execute a C pgm, check the Options menu =>Directories.
T

Thilagam S.

0 0
0

C, Cpp, Java, Python, Javascript Programming Languages
Learning C is as good as Learning a Natural Language(such as English, Hindi, Telugu, Tamil etc) We use Natural Languages to communicate with humans whereas we use Programming Languages such as C, Cpp,...
V

Vamshi

0 0
0

Swapping variable contents using C
/* WAP to swap the content of variables using C*/ //Header files #include<stdio.h>#include<conio.h> //Main function void main(){ //Variable declaration of type integer int a,b,c; //function...
S

C and C++ programming with memory level debugging
Understanding C and C++ programming by using memory level debugging. Step 1: Understand the Memory map of C executable Step 2: Start memory level debugging using popular IDE Step 3: Find the memory...

Programming Practice Technique
Any Programming Language required an Algorithm. Algorithm - It is the finite set of instructions in which each and every instruction has the meaning, instructions are not ambiguous and all the instructions...

Recommended Articles

Lasya Infotech is a Hyderabad based IT training institute founded in 2016 by O Venkat. Believing in his innovation, passion and persistence and with a diverse blend of experience, he started his brainchild to deliver exemplary professional courses to aspiring candidates by honing their skills. Ever since the institute envisions...

Read full article >

Brilliant Academy is one of the reputed institutes for B.Tech tuition classes. This institute is specialised in delivering quality tuition classes for B.E, Engineering - all streams and Engineering diploma courses. Incorporated in 2012, Brillant Academy is a brainchild of Mr Jagadeesh. The main motto of the academy is to...

Read full article >

Almost all of us, inside the pocket, bag or on the table have a mobile phone, out of which 90% of us have a smartphone. The technology is advancing rapidly. When it comes to mobile phones, people today want much more than just making phone calls and playing games on the go. People now want instant access to all their business...

Read full article >

Business Process outsourcing (BPO) services can be considered as a kind of outsourcing which involves subletting of specific functions associated with any business to a third party service provider. BPO is usually administered as a cost-saving procedure for functions which an organization needs but does not rely upon to...

Read full article >

Looking for C Language Classes?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you
X

Looking for C Language Classes?

The best tutors for C Language Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn C Language with the Best Tutors

The best Tutors for C Language Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more