vijay zanvar


{ City }
< Country > india
* Profession *
User No # 225
Total Questions Posted # 0
Total Answers Posted # 6

Total Answers Posted for My Questions # 0
Total Views for My Questions # 0

Users Marked my Answers as Correct # 96
Users Marked my Answers as Wrong # 53
Questions / { vijay zanvar }
Questions Answers Category Views Company eMail




Answers / { vijay zanvar }

Question { HP, 13718 }

What is structure packing ?


Answer

See: http://www.geocities.com/vijoeyz/faq/c/padding.txt

Best,
Vijay Zanvar,
Home Page - http://geocities.com/vijoeyz/



Is This Answer Correct ?    2 Yes 5 No

Question { 9791 }

How do I declare an array of N pointers to functions
returning pointers to functions returning pointers
to characters?


Answer

#include

/*
* How do I declare an array of N pointers to functions
* returning pointers to functions
* returning pointers to characters?
*/
int
main()
{
typedef char *f1();
typedef f1 *(*f2[4])();
return 0;
}


Best,
Vijay Zanvar,
Home Page - http://geocities.com/vijoeyz/


Is This Answer Correct ?    8 Yes 3 No


Question { 11590 }

How can I set an array's size at run time?


Answer

You can't do that in C. Use dynamic allocation method
to implement array. See Q. 20 and 41 in
http://www.geocities.com/vijoeyz/faq/

Best,
Vijay Zanvar,
Home Page - http://geocities.com/vijoeyz/


Is This Answer Correct ?    3 Yes 0 No

Question { HCL, 40764 }

enum day = { jan = 1 ,feb=4, april, may}
what is the value of may?
a)4 b)5 c)6 d)11
e)none of the above


Answer

enum day = { jan = 1 ,feb=4, april, may}

- should have been -

enum day { jan = 1 ,feb=4, april, may};

However, the answer is 6, i.e., the option C.

Best,
Vijay Zanvar,
Home Page - http://geocities.com/vijoeyz/


Is This Answer Correct ?    73 Yes 15 No

Question { TCS, 36726 }

x=2,y=6,z=6
x=y==z;
printf(%d",x)


Answer

y != z.
So, y == z is 0.
x = 0.

Best,
Vijay Zanvar,
Home Page - http://geocities.com/vijoeyz/


Is This Answer Correct ?    5 Yes 30 No

Question { IBM, 7507 }

What will be result of the following program?
void myalloc(char *x, int n)
{
x= (char *)malloc(n*sizeof(char));
memset(x,\0,n*sizeof(char));
}
main()
{
char *g="String";
myalloc(g,20);
strcpy(g,"Oldstring");
printf("The string is %s",g);
}
a) The string is : String
b) Run time error/Core dump
c) The string is : Oldstring
d) Syntax error during compilation
e) None of these


Answer

Run time error/Core dump.

Is This Answer Correct ?    5 Yes 0 No