ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
info       Did you received any Funny E-Mails from your Friends and like to share with rest of our friends? Yeah!! you can post that stuff   HERE
Google
 
Categories  >>  Software  >>  Programming Languages  >>  C
 
 


 

 
 C interview questions  C Interview Questions
 C++ interview questions  C++ Interview Questions
 VC++ interview questions  VC++ Interview Questions
 Delphi interview questions  Delphi Interview Questions
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions
Question
what is difference between array of characters and string
 Question Submitted By :: Sandipan
I also faced this Question!!     Rank Answer Posted By  
 
  Re: what is difference between array of characters and string
Answer
# 1
we can store set of names in string.but can only store set
of characters in array
 
Is This Answer Correct ?    11 Yes 7 No
Vijay
 
  Re: what is difference between array of characters and string
Answer
# 2
when we declare array of character it has 2 be teminated by 
null,but termination by null in case of string is automatic.
 
Is This Answer Correct ?    15 Yes 2 No
Vedavathi
 
 
 
  Re: what is difference between array of characters and string
Answer
# 3
aaray is nothing but set of data type
string is nothing but group of character
 
Is This Answer Correct ?    8 Yes 13 No
Varsha Vilas Kalebag
 
  Re: what is difference between array of characters and string
Answer
# 4
in char array space are not allowed means part after space 
not consider but in string it is allowed
 
Is This Answer Correct ?    7 Yes 5 No
Guest
 
  Re: what is difference between array of characters and string
Answer
# 5
In terms of C language,
string is nothing but the array of characters.
char a[10] is nothing but a string with 9 characters and a 
null..
 
Is This Answer Correct ?    3 Yes 6 No
Revathy
 
  Re: what is difference between array of characters and string
Answer
# 6
we can stoore set of names in string,but can store only 
charcter's in array
 
Is This Answer Correct ?    1 Yes 8 No
Rayees Ahmad
 
  Re: what is difference between array of characters and string
Answer
# 7
In case of a string, we cant print each character by 
character whereas for arrays of char we can do that.

String is terminated by a NULL character by default.
in array we have to explicitly do that.
 
Is This Answer Correct ?    7 Yes 4 No
Shruti
 
  Re: what is difference between array of characters and string
Answer
# 8
the compiler automatically puts a null character when we
insert a string...for eg "abc" for the compiler is "abc\0". 
but for a array of characters we need to assign a place for
it..for eg a[15] contains 14 characters and a null
character('\0').
 
Is This Answer Correct ?    4 Yes 1 No
Saumil
 
  Re: what is difference between array of characters and string
Answer
# 9
String is much same as character array, it can also be
checked by each characters:
string str;for(int i=0;str[i]!='\0';i++) cout <<str[i]<<endl;

1. The NULL terminator is loaded automatically in string.('\0')
2.Both of them drop the data after space when we take input.
 
Is This Answer Correct ?    9 Yes 0 No
Zubair
 
  Re: what is difference between array of characters and string
Answer
# 10
when we declare array of char it has to be terminated by 
null but termination by null in case of string is 
automatic.the compiler automatically puts a null char when 
we insert a string for example "kapil" for the 
string "kapil\0", but for a char array we need assign a 
place for it for example a[6] contains five char & a null 
char.& secondly
when char array is read through scanf() input function then 
spaces are not allowed if characters is read as string 
(through gets() function) spaces are allowedand are treated 
as a single char.
 
Is This Answer Correct ?    4 Yes 1 No
Kapil Kumar Verma Iimt Meerut
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
how do u find out the number of 1's in the binary representation of a decimal number without converting it into binary(i mean without dividing by 2 and finding out the remainder)? three lines of c code s there it seems...can anyone help  2
Is it possible to run a c program without using main?If yes HOW?? Wipro10
Difference between Class and Struct. Motorola6
What is alloca() and why is its use discouraged?  1
#include<stdio.h> main() { char s1[]="Ramco"; char s2[]="Systems"; s1=s2; printf("%s",s1); } what will happen if you executed this code? Ramco4
An interactive c program to read basic salary of 15 persons. each person gets 25% of basic as HRA, 15%of basic as conveyance allowances, 10%of basic as entertainment allowances.The total salary is calculated by adding basic+HRA+CA+EA.Calculate how many out of 15 get salary above 10,000.Rs also print the salary of each employee  2
what is the definition of storage classes? Wipro1
could u able to tell about suresoft technical session  1
what is a function pointer and how all to declare ,define and implement it ??? Honeywell3
CAN WE DEFINE ANY FUNCTION WITHIN A FUNCTION.  6
how to find the binary of a number? Infosys5
if ENTERED FIVE DIGITS DESIGN A PROGRAM THAT WILL FIND CORRESPONDING VALUE FROM ASCII TABLE  1
What is the output for the program given below typedef enum grade{GOOD,BAD,WORST,}BAD; main() { BAD g1; g1=1; printf("%d",g1); } ADITI3
what does exit() do? Cadence3
print the following using nested for loop. 5 4 3 2 1 1 2 3 4 3 2 1 1 2 1 2 1 1 2 3 4 3 2 1 1 2 3 4 5  5
main() { int i=400,j=300; printf("%d..%d"); } ME8
difference between my-strcpy and strcpy ? Geometric-Software3
Find the middle node in the linked list?? (Note:Do not use for loop, count and count/2) Subex2
how does the C compiler interpret the following two statements p=p+x; q=q+y; a.p=p+x; q=q+y b.p=p+xq=q+y c.p=p+xq; q=q+y d.p=p+x/q=q+y TCS3
write the program for maximum of the following numbers? 122,198,290,71,143,325,98  4
 
For more C Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com