what is difference between array of characters and string

Answer Posted / saumil

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 ?    24 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

In c programming typeing to occupy the variables in memory space. if not useing the variable the memory space is wasted.ok, how to avoid the situation..? (the variable is used & notused)

1623


List the difference between a 'copy constructor' and a 'assignment operator' in C?

631


How many bytes is a struct in c?

717


Can main () be called recursively?

620


What are the different types of errors?

635






What are compound statements?

622


What is the difference between c &c++?

641


Tell me can the size of an array be declared at runtime?

591


What is the difference between ‘g’ and “g” in C?

2493


Explain #pragma statements.

598


What are the data types present in c?

617


A function can make the value of a variable available to another by a) declaring the variable as global variable b) Passing the variable as a parameter to the second function c) Either of the two methods in (A) and (B) d) binary stream

660


Write a C program to help a HiFi’s Restaurant automate its breakfast billing system. Your assignment should implement the following items: a. Show the customer the different breakfast items offered by the HiFi’s Restaurant. b. Allow the customer to select more than one item from the menu. c. Calculate and print the bill to the customer. d. Produce a report to present your complete program and show more sample output. Assume that the HiFi’s Restaurant offers the following breakfast menu: Plain Egg $2.50 Bacon and Egg $3.45 Muffin $2.20 French Toast $2.95 Fruit Basket $3.45 Cereal $0.70 Coffee $1.50 Tea $1.80

2548


What is c variable?

544


When can you use a pointer with a function?

557