what is the difference between these initializations?
Char a[]=”string”;
Char *p=”literal”;
Does *p++ increment p, or what it points to?
Answer Posted / bee
logically, both are treated as array of characters(i.e.
string) but....
1) a is an array of characters(a string)
2) p is a pointer to an array of characters
the statement char *p = "literal" is equivalent to
char j[] = "literal"
char *p = j;
3) *p++ can be seen as *(p++)....
this is so because '++' has higher recedence over '*'
operator. so, it increments address by 1 unit and prints
the corresponding value value
| Is This Answer Correct ? | 5 Yes | 0 No |
Post New Answer View All Answers
What is New modifiers?
A routine usually part of the operation system that loads a program into memory prior to execution a) linker b) loader c) preprocessor d) compiler
what are bit fields in c?
Write a program to generate a pulse width frequency of your choise,which can be variable by using the digital port of your processor
What is the purpose of 'register' keyword in c language?
write a program to generate address labels using structures?
What is multidimensional arrays
How was c created?
Which is the memory area not included in C program? give the reason
what is event driven software and what is procedural driven software?
What is the value of a[3] if integer a[] = {5,4,3,2,1}?
Can a function be forced to be inline? Also, give a comparison between inline function and the C macro?
What are the different properties of variable number of arguments?
PLS U SENS ME INTERVIEW O. MY EMAIL ADD, SOFIYA.SINGH@GMAIL.COM
What are the salient features of c languages?