15.what is the disadvantage of using macros?
16.what is the self-referential structure?
17.can a union be self-referenced?
18.What is a pointer?
19.What is the Lvalue and Rvalue?
20.what is the difference between these initializations?
21.Char a[]=”string”;
22.Char *p=”literal”;
23.Does *p++ increment p, or what it points to?
Answer Posted / abdur rab
The difference between
21...in char a[]="string";
22... in char *p="literal";
is
in char a[]="string";, the memory is allocated, so the
value can be changed, it can be incremented, etc.
where as in char *p="literal";, you can just read it, may
be you can increment the pointer to point to the next
location, the content cannot be changed since this is a
string literal or BSS (Block Started by Symbol). This is
often called "const_data" or "data_const", or "literal".
23. *p++ it gets the content, and then increments the
pointer to the next location.
eg:
char a[] = {"string"};
char x;
char* p = (char*) a;
x = *p++;
printf ( "%c\n, %s\n", x, p );
output
======
s
tring
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What is the use of clrscr?
In a switch statement, what will happen if a break statement is omitted?
Explain what is the difference between a free-standing and a hosted environment?
How does pointer work in c?
Describe dynamic data structure in c programming language?
What is the use of getchar() function?
Why do we need functions in c?
What are the 5 types of inheritance in c ++?
Explain what are the different file extensions involved when programming in c?
Ow can I insert or delete a line (or record) in the middle of a file?
A variable that is defined in a specified portion of a program but can be used throughout the program a) global variable b) local variable c) character d) none
What is s or c?
On most computers additional memory that is accessed through an adapter of feature card along with a device driver program. a) user memory b) conventional memory c) expandedmemory d) area
What is the difference between strcpy() and memcpy() function in c programming?
shorting algorithmS