CoolInterview.com - World's Largest Collection of Interview Questions
 Interview Questions  
 Our Services  

Get 9,000 Interview Questions & Answers in an eBook.


  • 9500+ Pages
  • 9000 Question & Answers
  • All Tech. Categories
  • 14 MB Content

    Get it now !!


    Send your Resume to 6000 Companies


  • INTERVIEW QUESTIONS LANGUAGES C DETAILS
    Question :
    What is the difference between a string and an array?
    Category C Interview Questions
    Rating (0.0) By 0 users
    Added on 10/22/2004
    Views 3229
    Rate it!
    Answers:

    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.





    If you have the better answer, then send it to us. We will display your answer after the approval.
    Name :*
    Email Id :*
    Answer :*
    Verification Code Code Image - Please contact webmaster if you have problems seeing this image code Not readable? Load New Code
    Process Verification  Enter the above shown code:*
    Inform me about updated answers to this question

       
    Related Questions
    View Answer
    what is a modulus operator? What are the restrictions of a modulus operator?
    View Answer
    why n++ executes faster than n+1?
    View Answer
    Write the equivalent expression for x%8?
    View Answer
    Which expression always return true? Which always return false?
    View Answer
    What is storage class and what are storage variable ?
    View Answer
    What are the advantages of auto variables?
    View Answer
    Diffenentiate between an internal static and external static variable?
    View Answer
    What are advantages and disadvantages of external storage class?
    View Answer
    Differentiate between a linker and linkage?
    View Answer
    What are the characteristics of arrays in C?
    View Answer

    Please Note: We keep on updating better answers to this site. Subscribe to our newsletter to get notified when better answer is posted.

    Notify me when better answer is posted!
    Email:

    View ALL C Interview Questions

    User Options
    Sponsored Links


    Copyright ©2003-2009 CoolInterview.com, All Rights Reserved.
    Privacy Policy | Terms and Conditions
    Page URL: http://www.coolinterview.com/interview/984/default.asp?cachecommand=bypass


    Download Yahoo Messenger | Placement Papers| FREE SMS | ASP .Net Tutorial | Web Hosting | Dedicated Servers | Joke of the Day

    0.8