Question

define a new type called mylist that points to a structure named listnode that consists of two parts, an array of 5 integ
0 0
Add a comment Improve this question Transcribed image text
Answer #1

#include<stdio.h>
#include<stdlib.h>

//created struct named listnode consists of data array of size 5 and next pointer
struct listnode{
int data[5];
struct listnode *next;
};

int main()
{
//defined mylist of type listnode
struct listnode *mylist = (struct listnode*)malloc(sizeof(struct listnode));
return 0;
}

//any query, post in the comment section

Add a comment
Know the answer?
Add Answer to:
define a new type called "mylist" that points to a structure named "listnode" that consists of...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Assume a class exists named MyList that has contained in it a data attribute of type...

    Assume a class exists named MyList that has contained in it a data attribute of type MyNode that is named head. The class MyList represents a singly-linked list. In the MyNode class, there is a getter method named getNext() that returns he next node in the linked list. Implement an instance method named print() that takes no formal parameters, returns nothing, and prints out the string representation of each node in the linked list from head to tail, with each...

  • ***CODE MUST BE IN C++*** Using the linked list in "basic linked list" which has a...

    ***CODE MUST BE IN C++*** Using the linked list in "basic linked list" which has a STRUCTURE for each node, write FUNCTION which starts at the head and outputs the value for each node until the last node is reached. Note: your function should work with the structure that is in this program. Please do not use the example which is for a class, but this example canbe helkpful.  Also note that the function must work no matter how many nodes...

  • 15. Define a class called Point. It has two private data members: x and y with int type; and three public member functions: a constructor, setPoint(int, int) and printPoint0. The constructor init...

    15. Define a class called Point. It has two private data members: x and y with int type; and three public member functions: a constructor, setPoint(int, int) and printPoint0. The constructor initializes the data members to 0. You need to use the operator?: to test whether x and y are positive. If not, assign them to 0. The function printPoint prints the message "(X, Y)" where X and Y are two integers. In the main program, first input the number...

  • the coding language is in c++ An array named testScores has already been declared. -size= 5...

    the coding language is in c++ An array named testScores has already been declared. -size= 5 -data type = float - the array has already been initialized these values: 77, 88.5, 90, 93, 71.5 -Write one statement to declare a pointer named: ptr - in the same statement, assign the address to the testScores array to the pointer -write one statement to output the memory address of the array element at testScores[0] -Write a for loop to output the values...

  • 1. Define a structure named StockItem with two string fields, supplier and productName and one int field, catalogNumber...

    1. Define a structure named StockItem with two string fields, supplier and productName and one int field, catalogNumber. Then define a structure named Customer with string fields name, streetAddress, city, postalCode, phone. Assume that structures named Date and Money have already been defined (representing a date and a monetary amount respectively. Finally, define a structure named Purchase that has these fields: buyer of type Customer, itemSold of type StockItem, dateOfSale of type Date, paid of type Money, returnable of type...

  • Help fast :Assume a variable called orange exists of type Fruit pointer. The Fruit structure is...

    Help fast :Assume a variable called orange exists of type Fruit pointer. The Fruit structure is defined below. For the variable orange, write a statement that assigns a member variable named hasSeeds to 1 typedef struct Fruit struct f a. &(orange.hasSeeds) 1; b. orange.("hasSeeds) 1 c. orange->hasSeeds 1; d. orange.hasSeeds 1; // menber variables Fruit; Q8: When the malloc function is called, the malloc function returns a(n) a. address on the heap b. address on the stack c. address on...

  • c++ code Lab Exercises This assignment consists of two exercises. Exercise 1- Count Inversions Exercise Objectives...

    c++ code Lab Exercises This assignment consists of two exercises. Exercise 1- Count Inversions Exercise Objectives Define and call functions ✓ Using Array Using nested loop ✓ Using input/output statement Problem Description Inside "Lab2" folder, create a project named "Lab2Ex1". Use this project to write and run a C++ program that produces: Define a constant value called A_SIZE with value of 10. ► Declare an integer 10 array of size A_SIZE called Arr. Define a function called Read that accept...

  • using visual studio 2) For each of the following, write C++ statements that perform the specified...

    using visual studio 2) For each of the following, write C++ statements that perform the specified task.. (Ref: classwork named pointer2) a) Declare a built-in array of type unsigned int called values with five elements, and initialize the elements to the even integers from 2 to 10. b) Declare a pointer vPtr that points to a variable of type unsigned int. c) Write two separate statements that assign the starting address of array values to pointer variable vPtr. d) Use...

  • Define a structure called Date with month, day and year as its only data members, Time...

    Define a structure called Date with month, day and year as its only data members, Time with hour and minute as its only members and Event with desc (a c-string for description of maximum size 80), date (of type Date) and time (of type Time). Write a readEvents() function that will keep asking the user if he or she wants to add a new event. As long as the user answers with a 'y' or 'Y', allocate memory dynamically for...

  • Problem H1 (Using C++) In the main function, define four variables of type int, named: first,...

    Problem H1 (Using C++) In the main function, define four variables of type int, named: first, second, third, and total. Write a function named getData that asks the user to input three integers and stores them in the variables first, second, and third which are in the main function. Write a function named computeTotal that computes and returns the total of three integers. Write a function named printAll that prints all the values in the format shown in the following...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT