C
Programming and Technical
Programming
Program
Is the following statement a declaration or definition?
extern int i;
Options
1) Declaration
2) Definition
3) Function
4) Error
Read Solution (Total 13)
-
- see at the stmt int *ptr=(int*)malloc(sizeof(int)); here malloc will request for memory of size int if its request is granted than that size of block assigned to ptr variable..not *ptr=4; *ptr has value 4 now next line printf("%d",(*ptr)+++*ptr++); see how it will be solve (4++ + 5++) i just puted the corresponding values... it will be solved as 4+5(will dicard last post increment )
so ans should be (b) ie 9 - 11 years agoHelpfull: Yes(3) No(0)
- 1. declaration will b d ans
- 9 years agoHelpfull: Yes(2) No(0)
- 8
both are the post incrment operator - 10 years agoHelpfull: Yes(0) No(1)
- may be ans is 9.....((*ptr)++ + *ptr++); for first post increment it will not incremented for next calling it will incremented(i.e second increment) then 4+5=9
- 10 years agoHelpfull: Yes(0) No(1)
- It causes an error message
- 10 years agoHelpfull: Yes(0) No(0)
- the declaration does not contain the static or extern keywords.
- 9 years agoHelpfull: Yes(0) No(0)
- 1
extern is storage class
extern use as a data type - 9 years agoHelpfull: Yes(0) No(0)
- ans 1
extern keyword is used only for declaration bt nt for definition
- 9 years agoHelpfull: Yes(0) No(0)
- it is declaration.
its definition will be outside of main function. - 9 years agoHelpfull: Yes(0) No(0)
- it is declaration statement
- 9 years agoHelpfull: Yes(0) No(0)
- 1. Delaration
- 9 years agoHelpfull: Yes(0) No(0)
- declaration
- 9 years agoHelpfull: Yes(0) No(0)
- option -2
it is definition because extern keyword is used for referencing the variable form one program to other program - 7 years agoHelpfull: Yes(0) No(0)
C Other Question