Adarsh R.

asked • 04/14/22

using c language

ASCII (American Standard Code for Information Interchange) was originally developed as a

binary to text translation for less complex computer systems. Today, it is an industry standard that allows

not only 8 bit/1 byte binary translations but synonymous decimal, binary, and hex number system

translations as well.

Create a program that can convert a character string to a set of integer values to demonstrate one

possible translation using ASCII

Build a Main() function with all dependent header files. Make a preprocessor define with

value 10.

 In the Main, prompt the user to enter a character string. Store it dynamically in memory

(Use the define above as a max string length). 

 Prototype a function named Convert() that accepts a pointer to char and returns a

pointer to int. 

 Convert() - this function will iterate through every character of the string until the null

(\0) character is reached. In each iteration, copy the character into an integer variable.

Assign the variable to a dynamically (again in memory with max number being define

above) created integer array. Return a reference to the dynamic memory integer array.


 Print out each number in the dynamic memory integer array to the console. (/2)

 Prototype a function named Print() that accepts a pointer to int. This function has no

return value. 

 Print() - this function will print the dynamic int array to a file. Each value must be

separated by a space. Remember to iterate and go value by value, all valid values are

greater than or equal to 0. 


1 Expert Answer

By:

Donald W. answered • 04/14/22

Tutor
5.0 (214)

Senior Software Engineer with over 25 years of industry experience

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.