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

Which should I learn first, C or UNIX?
As you know C is a programming language and UNIX is Operating System if you want to grow your career as Programmer/Developer than go for C/C++ programming as it is very basic programming languages and...
Tushar
0 0
5
In Java programming, what are the differences between the functions of 'int' and 'int []' when working with an array?
The may appear as part of the type at the beginning of the declaration, or as part of the declarator for a particular variable but But int a keeps type information together and is more verbose so I prefer it.
Kalpana
0 0
5
Which language is best, C, C++, Python or Java?
If you want to learn any languages C#, Java, ect. then must to learn C, C++ language as these are base or language to be strong in language skills. C++ is improved version of C language. C#, Java, J# and etc. which are improved version of C++.
Sribaghya
0 0
6
how the right shift operator works on a numerical value?? eg:- 8>>3=?
first convert numerical value to binary value then arrange into bits and shift 3 bit on right then convert binary value to decimal value.
Abhishek

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

Ask a Question

Related Lessons

Advantages of C++ Language
Advantages of C++ - C++ is a profoundly convenient dialect and is frequently the dialect of decision for multi-gadget, multi-stage application advancement. - C++ is a protest situated programming dialect...

INTRODUCTION TO PROGRAMMING LANGUAGES
Language is a medium for communication. If we want to perform anything with another person, we can know the human language as a human being. Similarly, if we want to perform anything with a computer, we...

Dynamic Memory Allocation in C using malloc()
#include <stdio.h>#include <conio.h>//#include <malloc.h> OR#include <stdlib.h>void main(){ int *ptr, i, n, sum = 0; printf("how many elements ? "); scanf("%d", &n);...

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

C PROGRAM FOR GENERATING SOUND
#include<stdio.h> #include<conio.h> #include<dos.h> void main() { sound(3000); // sound function have single parameter , this parameter we put integer value its generating...

V. Muthu Ganeshan

0 0
0

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