Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

how implement memory allocation with strings.

need to use a temporary variable to hold a string of

MAX_GENERATED_WORD_LENGTH characters which you will use to store the

string representing the word you are building. When this function returns, the temporary

variable should not be stored anymore in memory.

 

You will then iterate over the list of symbols provided to your function. This list is

implemented in an array named symbols of size nbSymbols. Each element of this array is

an int representing the atomic number of the element which symbol we want to use to spell a word.

The atomic numbers are to be used as parameter to the getElementSymbol function which will return the string representing this element's symbol.

 

These strings need to be concatenated to your temporary string in order to build the word represented

by the series of atomic numbers in the parameter symbols.

 

This is what I have so far:

 

char* elementsBuildWord(const int symbols[], int nbSymbols){

/* ROLE takes a list of elements' atomic numbers and allocate a new string made

of the symbols of each of these elements

PARAMETERS symbols an array of nbSymbols int which each represent the atomic number

of an element

nbSymbols symbols array's size

RETURN VALUE NULL if the array is of size <= 0

or if one of the symbols is not found by our getElementSymbol function

other the address of a newly allocated string representing the concatenation

of the names of all symbols

*/

 

if (nbSymbols <= 0){return NULL;}

if (!symbols) {return NULL;}

 

 

return NULL; // just here to let the project compile, implement your own version of this function

}

 

 

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M9456814

Have any Question?


Related Questions in Computer Engineering

Asses the challenges faced by financial managers due to

Asses the challenges faced by financial managers due to changes in the macroeconomic environment and how these impact businesses operations. Emphasize how there are consequences related to changes in strategies and prior ...

Question after reading this chapter you should now be

Question : After reading this chapter, you should now be familiar with the "Fun" part of Java utilizing the GUI. The GUI offers all kinds of functionality in the graphical sence. Why do you think Java and Javas GUI are s ...

Shellys preferences for consumption and leisure can be

Shelly's preferences for consumption and leisure can be expressed as U(C, L) = (C - 100) (L - 40). This utility function implies that Shelly's marginal utility of leisure is C - 100 and her marginal utility of consumptio ...

Is smartart graphic and table slide important for

Is Smartart graphic and Table slide important for PowerPoint Presentation? How would it benefit?

The second programming project involves writing a program

The second programming project involves writing a program that accepts an arithmetic expression of unsigned integers in postfix notation and builds the arithmetic expression tree that represents that expression. From tha ...

Ellen is an anthropologist who has been working at olduvai

Ellen is an anthropologist who has been working at Olduvai Gorge in Tanzania for the past six months. She has been conducting research on the Internet. She finds a Web site with an article that proposes a revolutionary t ...

Question 1 the facilities coordinator is a critical role

Question: 1. The facilities coordinator is a critical role. Put yourself in the position of the facilities coordinator. 2. Determine and list the qualities you have that would make you an excellent candidate for this pos ...

Ellen is an anthropologist who has been working at olduvai

Ellen is an anthropologist who has been working at Olduvai Gorge in Tanzania for the past six months. She has been conducting research on the Internet. She finds a Web site with an article that proposes a revolutionary t ...

Question 52 consider the following objects and their

Question 5.2: Consider the following objects and their properties: Car: fuel capacity, serial number, passenger capacity, net weight, license plate Boat: fuel capacity, serial number, passenger capacity, net weight, draf ...

What are the tax reforms included in the train lawhow would

What are the tax reforms included in the TRAIN law? How would it impact the bottom 60% of the households and the top 40% of the households? Lastly, how does the being proposed transfer scheme works? Source: https://opini ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As