What is the difference between char a[] = "string"; and
char *p = "string"; ?
Answer Posted / srinivas
a is a const pointer, whereas p is not
meaning 'a' will point to a fixed location (value of 'a' or
address of *a can't change, remains fixed) - though
contents of a can be changed (by way of accessing a[i])
Is This Answer Correct ? | 36 Yes | 6 No |
Post New Answer View All Answers
An application package has been provided to you without any documents for the following application. The application needs to be tested. How will you proceed?
Can the “if” function be used in comparing strings?
how to find binary of number?
What is floating point constants?
main() { inta=10,b=20; a>=5?b=100:b=200; printf("%d ",b); }
What is exit() function?
Write a Program to find whether the given number or string is palindrome.
Explain union.
Why do we use return in c?
How can I trap or ignore keyboard interrupts like control-c?
What are dangling pointers? How are dangling pointers different from memory leaks?
How is a null pointer different from a dangling pointer?
What are predefined functions in c?
Explain what are global variables and explain how do you declare them?
What are compound statements?