Question: This uses C (C ONLY PLEASE) Please THis are the last 3 questions I need PLease someone help me I have less than an hour


This uses C (C ONLY PLEASE) Please THis are the last 3 questions I need PLease someone help me I have less than an hour left :(.
Consider the following struct typedef struct My Struct { int x; int y; } MyStruct; Which of the following is the correct statement for dynamically allocating an array of My Structs? Assume there will be 10 elements. MyStruct array[ 10 ] (MyStruct) malloc( sizeof (MyStruct)); MyStruct *arr = (MyStruct) malloc( sizeof (My Struct) + 10 ); MyStruct tarr = (MyStruct *) malloc( sizeof(MyStruct) + 10 ); MyStruct #arr = (MyStruct *) calloc( sizeof(MyStruct) + 10 ); = What is another correct way of declaring this string that would not cause problems when working with other strings and/or string functions? char str[] = "Hello"; char str[] = { 'H', 'e', 'l', 'l', 'o', '10' }; char str[] = { "H", "e", "1", "1", "6" }; char str[] = { 'H', 'e', 'l', 'l', 'o' }; char str = "H", "e" "1", "1", "0"; Consider the following struct typedef struct MyStruct { int x; int y; } My Struct; Which of the following is the correct syntax for accessing a data member of a dynamically allocated struct pointer object named m? M-X; m->x; m[ X ]; m. X
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
