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
Sir i need notes for structure,functions,pointers in c language can you help me please
What is a lookup table in c?
what is the c source code for the below output? 10 10 10 10 10 10 10 10 10 10 9 9 7 6 6 6 6 6 6 9 7 5 9 7 3 2 2 5 9 7 3 1 5 9 7 3 5 9 7 4 4 4 4 5 9 7 8 8 8 8 8 8 8 8 9
What is a ternary operator in c?
How will you declare an array of three function pointers where each function receives two ints and returns a float?
What are qualifiers?
Explain how do you determine the length of a string value that was stored in a variable?
Which is best linux os?
What is define directive?
What are different types of operators?
If errno contains a nonzero number, is there an error?
program to find error in linklist.(i.e find whether any node point wrongly to previous nodes instead of next node)
What does #pragma once mean?
Write a Program to accept different goods with the number, price and date of purchase and display them
Write the Program to reverse a string using pointers.