What is the difference between char a[] = "string"; and
char *p = "string"; ?

Answer Posted / abc

we cannot assign a string to another but we can assign a
char pointer to another char pointer.

Is This Answer Correct ?    23 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why is it important to memset a variable, immediately after allocating memory to it ?

1541


Is it possible to execute code even after the program exits the main() function?

799


What is character constants?

704


What are pointers really good for, anyway?

604


What is string length in c?

597






What is C language ?

1517


How many parameters should a function have?

652


An expression to whose value an operater is applied a) operand b) variable c) constant d) all of the above

643


Explain the ternary tree?

590


What is keyword in c?

583


When should the const modifier be used?

645


How can I get random integers in a certain range?

604


what is the basis for selection of arrays or pointers as data structure in a program

3779


Sir,please help me out with the code of this question. Write an interactive C program that will encode or decode multiple lines of text. Store the encoded text within a data file, so that it can be retrieved and decoded at any time. The program should include the following features: (a) Enter text from the keyboard, encode the text and store the encoded text in a data file. (b) Retrieve the encoded text and display it in its encoded form. (c) Retrieve the encoded text, decode it and then display the decoded text. (d) End the computation. Test the program using several lines of text of your choice.

1753


What is the general form of a C program?

590