what is difference between array of characters and string

Answer Posted / punit shukla,hbti-kanpur

1.major difference is: string will have static storage
duration, whereas as a character array will not, unless it
is explicity specified by using the static keyword.
2.Two strings of same value[1] may share same memory area
bt not in the case of char arrays

Is This Answer Correct ?    11 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the advantages and disadvantages of c language?

556


any "C" function by default returns an a) int value b) float value c) char value d) a & b

663


what is bit rate & baud rate? plz give wave forms

1512


What are the benefits of organizational structure?

568


How do you view the path?

663






How will you declare an array of three function pointers where each function receives two ints and returns a float?

773


What are the 4 data types?

592


How can I implement sets or arrays of bits?

601


The purpose of this exercise is to benchmark file writing and reading speed. This exercise is divided into two parts. a). Write a file character by character such that the total file size becomes approximately >10K. After writing close the file handler, open a new stream and read the file character by character. Record both times. Execute this exercise at least 4 times b). Create a buffer capable of storing 100 characters. Now after generating the characters, first store them in the buffer. Once the buffer is filled up, store all the elements in the file. Repeat the process until the total file size becomes approximately >10K.While reading read a while line, store it in buffer and once buffer gets filled up, display the whole buffer. Repeat the exercise at least 4 times with different size of buffer (50, 100, 150 …). Records the times. c). Do an analysis of the differences in times and submit it in class.

1626


Why clrscr is used after variable declaration?

1035


What are nested functions in c?

560


int far *near * p; means

3115


What are linked lists in c?

647


What is define c?

568


How reliable are floating-point comparisons?

622