1.  What is the missing statement in the following function which copies string x into string y ?
void strcpy (char *x, char *y)
{
while (*y!='\0')
................./*missing statement*/
*x='\0';
}
What will be the result of execution?


x = y
*x++ = *y++
(*x)++ = (*y)++
none of these


Answer

 Option

Pointer variable char *x is pointing to a location and the char *y is assigned to that location. If we assume the missing statement is *x++=*y++ then both the variables point to the next respective location till null ('\0') found.

Workspace

Report
Mail id: Report Error:

Answer Workspace Report

2.  Let x be an array. Which of the following cannot be present in the left hand side of an assignment statement ?


X
&x[i]
x + i
All of these


Answer

 Option

No answer description available for this question.

Workspace

Report
Mail id: Report Error:

Answer Workspace Report

3.  Consider the two declarations
void *voidPtr;
char *charPtr;
Which of the following assignments are syntactically correct ?


voidPtr = charPtr
charPtr = voidPer
*voidPtr = *charPtr
*charPtr = voidPtr


Answer

 Option

No answer description available for this question.

Workspace

Report
Mail id: Report Error:

Answer Workspace Report

4.  The operator > and < are meaningful when used with pointers, if


the pointers point to data of similar type
the pointers point to structure of similar data type
the pointers point to elements of the same array
none of these


Answer

 Option

No answer description available for this question.

Workspace

Report
Mail id: Report Error:

Answer Workspace Report

5.  Given float *pf; int *pi; Which of thefollowing is true ?


sizeof(pf) > sizeof(pi)
sizeof(pi) < sizeof(pf)
sizeof(pf) == sizeof(pi)
None of these above


Answer

 Option

No answer description available for this question.

Workspace

Report
Mail id: Report Error:

Answer Workspace Report