MCQOPTIONS
Bookmark
Saved Bookmarks
→
Typedef
→
General in Typedef
→
Is the following declaration acceptable?
1.
Is the following declaration acceptable?
typedef long no, *ptrtono; no n; ptrtono p;
A.
Yes
B.
NO
Answer» B. NO
Show Answer
Discussion
No Comment Found
Post Comment
Related MCQs
<p>typedef's have the advantage that they obey scope rules, that is they can be declared local to a function or a block whereas #define's always have a global effect.</p>
<p>Are the properties of i, j and x, y in the following program same?</p> <pre> <code>typedef unsigned long int uli; uli i, j; unsigned long int x, y;</code></pre> <p> </p>
<p>Is there any difference in the <em>#define</em> and <em>typedef</em> in the following code?</p> <pre> <code>typedef char * string_t; #define string_d char *; string_t s1, s2; string_d s3, s4;</code></pre> <p> </p>
<p>Is the following declaration acceptable?</p> <pre> <code>typedef long no, *ptrtono; no n; ptrtono p;</code></pre> <p> </p>
<p>In the following code snippet can we declare a new typedef named ptr even though struct employee has not been completely declared while using typedef?</p> <pre> <code>typedef struct employee *ptr; struct employee { char name[20]; int age; ptr next; }</code></pre> <p> </p>
<p>Point out the error in the following code?</p> <pre> <code>typedef struct { int data; NODEPTR link; }*NODEPTR;</code></pre> <p> </p>
<p>What will be the output of the program?</p> <pre> <code>#include<stdio> typedef struct error {int warning, err, exception;} ERROR; int main() { ERROR e; e.err=1; printf("%d n", e.err); return 0; }</stdio></code></pre> <p> </p>
<p>What will be the output of the program?</p> <pre> <code>#include<stdio> int main() { typedef float f; static f *fptr; float fval = 90; fptr = &fval; printf("%f n", *fptr); return 0; }</stdio></code></pre> <p> </p>
<p>What will be the output of the program?</p> <pre> <code>#include<stdio> int main() { typedef int LONG; LONG a=4; LONG b=68; float c=0; c=b; b+=a; printf("%d,", b); printf("%f n", c); retu</stdio></code></pre> <p> </p>
<p>What will be the output of the program?</p> <pre> <code>#include<stdio> int main() { enum color{red, green, blue}; typedef enum color mycolor; mycolor m = red; printf("%d", m); return 0; }</stdio></code></pre> <p> </p>
Reply to Comment
×
Name
*
Email
*
Comment
*
Submit Reply