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


Please Help Members By Posting Answers For Below Questions

Sir i need notes for structure,functions,pointers in c language can you help me please

1939


What is a lookup table in c?

618


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

1422


What is a ternary operator in c?

646


How will you declare an array of three function pointers where each function receives two ints and returns a float?

770






What are qualifiers?

611


Explain how do you determine the length of a string value that was stored in a variable?

661


Which is best linux os?

552


What is define directive?

631


What are different types of operators?

588


If errno contains a nonzero number, is there an error?

789


program to find error in linklist.(i.e find whether any node point wrongly to previous nodes instead of next node)

1616


What does #pragma once mean?

677


Write a Program to accept different goods with the number, price and date of purchase and display them

5426


Write the Program to reverse a string using pointers.

609