void main()
{
void *v;
int integer=2;
int *i=&integer;
v=i;
printf("%d",(int*)*v);
}
Answer / susie
Answer :
Compiler Error. We cannot apply indirection on type void*.
Explanation:
Void pointer is a generic pointer type. No pointer
arithmetic can be done on it. Void pointers are normally
used for,
1. Passing generic pointers to functions and returning such
pointers.
2. As a intermediate pointer type.
3. Used when the exact pointer type will be known at a later
point of time.
| Is This Answer Correct ? | 11 Yes | 1 No |
Give a one-line C expression to test whether a number is a power of 2.
main() { char *p="hai friends",*p1; p1=p; while(*p!='\0') ++*p++; printf("%s %s",p,p1); }
main() { int a=10,*j; void *k; j=k=&a; j++; k++; printf("\n %u %u ",j,k); }
void main() { while(1){ if(printf("%d",printf("%d"))) break; else continue; } }
Write a program to check whether the number is prime and also check if it there i n fibonacci series, then return true otherwise return false
Extend the sutherland-hodgman clipping algorithm to clip three-dimensional planes against a regular paralleiepiped
void pascal f(int i,int j,int k) { printf(ā%d %d %dā,i, j, k); } void cdecl f(int i,int j,int k) { printf(ā%d %d %dā,i, j, k); } main() { int i=10; f(i++,i++,i++); printf(" %d\n",i); i=10; f(i++,i++,i++); printf(" %d",i); }
Given an array of characters which form a sentence of words, give an efficient algorithm to reverse the order of the words (not characters) in it.
main() { printf("%d, %d", sizeof('c'), sizeof(100)); } a. 2, 2 b. 2, 100 c. 4, 100 d. 4, 4
18 Answers HCL, IBM, Infosys, LG Soft, Satyam,
#include<stdio.h> main() { register i=5; char j[]= "hello"; printf("%s %d",j,i); }
Who could write how to find a prime number in dynamic array?
Give a very good method to count the number of ones in a 32 bit number. (caution: looping through testing each bit is not a solution)