Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How can the queue msgBuffer store 2 things…We can only instantiate it with one type?

0
Posted

How can the queue msgBuffer store 2 things…We can only instantiate it with one type?

0

A. The write-up says to create a class MsgInfo. That class will have data members to hold 2 things. MsgInfo is the type with which you’ll instantiate the queue. And, it will be the type of things you’ll add and remove. Thus, although a queue stores one “type” of thing, that thing can itself store multiple pieces of information. • Q. Must we write member functions for MsgInfo? A. No. Make everything public if you like. • Q. Do we read the files ‘nodes’ ‘neighbors’ and ‘network-inputs’ in the same way as last assignment? A. Opening and parsing the files is the same, although there are some differences in how you process them. I.e., you only go through each file once (unlike last time). • Q. When we are reading the files (e.g., ‘nodes’) should we be using a loop? A. Yes. Some kind of loop is needed. • Q. I’m not sure about allocating the NetworkNodes…. When we allocate memory we need a pointer. Won’t all the nodes have the same pointer, causing problems? A. A pointer can store the addre

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123