Here is some additional practice using structs. Some of these might take a little bit of thinking, but this practice is here to help you get more comfortable with the material.
But first, some typedef
fun.
typedef
Practice100.00 - 89.00 = 11.00
?int main(void)
{
typedef double more_precise_number;
typedef float less_precise_number;
more_precise_number x = 100;
less_precise_number y = 89;
printf("%___ - %___ = %___\n", x, y, x - y);
return 0;
}
main()
? Would it compile at all? Assume all necessary
libraries are included.struct my_structure
{
int x;
char text[64];
};
int main(void)
{
struct my_structure structy_mc_struct_face;
("%d\n", structy_mc_struct_face.x);
printf
return 0;
}
struct my_structure
{
int x;
char text[64];
};
int main(void)
{
struct my_structure structy_mc_struct_face;
structy_mc_struct_face.x = 65;
printf("%c\n", structy_mc_struct_face.x);
return 0;
}
struct
every time I want to create an
instance of the my_structure
struct? See the previous
question on line 9 for reference.See the “Pointers Practice” page for practice on this!