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 are structures and unions? State differencves between them.
diff between exptected result and requirement?
Is it better to bitshift a value than to multiply by 2?
What are the features of c languages?
FORMATTED INPUT/OUTPUT functions are a) scanf() and printf() b) gets() and puts() c) getchar() and putchar() d) all the above
Explain what is the difference between text files and binary files?
There seem to be a few missing operators ..
What is the meaning of ?
Did c have any year 2000 problems?
Explain what are linked list?
Why doesnt that code work?
What is the process to generate random numbers in c programming language?
What is #line in c?
largest Of three Number using without if condition?
Who is the main contributor in designing the c language after dennis ritchie?