microsoft
Company
Category
#include ‹stdio.h›
#include ‹string.h›
struct name{
char lastname[20];
char firstname[20];
};
struct name full_name;
void display_name(struct name *p);
int main(void)
{ struct name *name_ptr;
______________ ;-- Statement to be filled ........
}
In the above code, fill in the correct usage of the function pointer in the line ‘Statement to be filled” from the list below.
name_ptr = &full_name
&name_ptr = full_name
name_ptr = &name
name_ptr = name
Read Solution (Total 7)
-
- name_ptr=&full_name
- 9 years agoHelpfull: Yes(5) No(0)
- name_ptr=&full_name
- 7 years agoHelpfull: Yes(1) No(0)
- Answer: name_ptr=&full_name;
because name_ptr is pointer variable of structure "name" itself and it only contains the address of the same data type variables, i.e. struct name full_name
Note: We all know that the pointer variable only contains the address of the same datatype variable.So that's why here the option 2 & 4 easily neglected. - 6 years agoHelpfull: Yes(1) No(0)
- name_ptr = &full_name
- 8 years agoHelpfull: Yes(0) No(0)
- name_ptr=&full_name because strucute work on address on variable
- 8 years agoHelpfull: Yes(0) No(1)
- name_ptr = &full_name
- 8 years agoHelpfull: Yes(0) No(0)
- name_ptr=&full_name is the answer
- 7 years agoHelpfull: Yes(0) No(0)
microsoft Other Question