difference between string and array?
Answers were Sorted based on User's Feedback
Answer / teja
array : array is a collection of similar datatypes like
integer types or character types
string : string is a collection of characters of any size
| Is This Answer Correct ? | 2 Yes | 1 No |
Answer / gnaneshwar
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.
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / paramesh
a string is collection of characters but an array is
collection of similar data types
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / guest
string is a sequence of characters where as array is
collections of differnt strings which are having same data type.
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / sonu
string:string is a collection of similar datatype,like
"sneha".
array:an array is a collection of different datatype,like
a[10].we can store charactor value as well as integer.
| Is This Answer Correct ? | 5 Yes | 7 No |
What are the rules for the identifier?
differentiate between const char *a; char *const a; and char const *a;
2 Answers College School Exams Tests, HCL, TCS,
Why is it important to memset a variable, immediately after allocating memory to it ?
What is mean by data types in c?
You have an int array with n elements and a structure with three int members. ie struct No { unsigned int no1; unsigned int no2; unsigned int no3; }; Point1.Lets say 1 byte in the array element is represented like this - 1st 3 bits from LSB is one number, next 2 bits are 2nd no and last 3 bits are 3rd no. Now write a function, struct No* ExtractNos(unsigned int *, int count) which extracts each byte from array and converts LSByte in the order mentioned in point1.and save it the structure no1, no2, no3. in the function struct No* ExtractNos(unsigned int *, int count), first parameter points to the base address of array and second parameter says the no of elements in the array. For example: if your array LSB is Hex F7 then result no1 = 7, no2 = 2, no3 = 7. In the same way convert all the elements from the array and save the result in array of structure.
What are the advantages and disadvantages of pointers?
How to create struct variables?
how can use subset in c program and give more example
code for concatination of 2 strings with out using library functions?
write a own function for strstr
Write a C program to get the desired output. 1 1 2 1 1 3 3 1 1 4 6 4 1 1 5 10 10 5 1 . . . 1 n..............n 1 Note: n is a positive integer entered by the user.
Why doesn't the code "int a = 1000, b = 1000; long int c = a * b;" work?