adplus-dvertising
frame-decoration

Question

Point out the error in the following program.
#include<stdio.h>
#include<stdlib.h>

int main()
{
    static char *p = (char *)malloc(10);
    return 0;
}

a.

Error: Lvalue required

b.

Error: Rvalue required

c.

Error: invalid *p declaration

d.

No error

Answer: (d).No error

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. Point out the error in the following program.

Similar Questions

Discover Related MCQs

Q. An external variable

Q. The declaration "unsigned u" indicates u is a/an

Q. A declaration "short int" is used for variables

Q. Which of the following 'C' type is not a primitive data structure?

Q. Printing a character as an integer

Q. The program fragment

int i = 263 ;
putchar (i) ;
prints

Q. int i = 5; is a statement in a C program.

Q. If the declaration unsigned c:5; is replaced by
unsigned : 6;
then

Q. The value of ab if ab & 0 x 3f equals 0 x 27 is

Q. In C programming language, if the first and the second operands of operator + are of types int and float, respectively, the result will be of type

Q. C programming language provides operations which deal directly with objects such as

Q. C programming language by itself provides

Q. The variables which can be accessed by all modules in a program, are called

Q. The rule for implicit type conversion in 'C' is

Q. Consider the following statement:

#define hypotenuse (a, b) sqrt (a*a + b*b);
The macro-call hypotenuse (a + 2, b + 3);

Q. A static variable

Q. The statement
# include < math.h>
is written at the top of a program to indicate

Q. The declarations
typedef float hight [100];
height men, women;

Q. In case of ordinary int variables

Q. If a is an unsigned integer variable whose value is hx6db7, what is the value of -a?