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
Using which language Test cases are added in .ptu file of RTRT unit testing???
How is = symbol different from == symbol in c programming?
What is the function of this pointer?
Explain can you assign a different address to an array tag?
What is structure padding and packing in c?
How can I ensure that integer arithmetic doesnt overflow?
What is dangling pointer in c?
What is typedef struct in c?
what is the different bitween abap and abap-hr?
One of the Institutes contains 5 student groups. Every group contains 4 students. Institute wants to store student group’s details in array. Group should contain group member’s details (name and registration number and age), project name, and mark of the group.
please send me the code for multiplying sparse matrix using c
Is flag a keyword in c?
What is the difference between test design and test case design?
What is the mean of function?
An integer that indentifies the position of a data item in a sequence of data items a) value b) number c) index d) all of the above