Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You are to create a C program which fills an integer array with integers and then you are to cast it as a char *

You are to create a C program which fills an integer array with integers and then you are to cast it as a "char * and print it out the string relating the "char * The output of the string should be your first and last name with proper capitalization, spacing and punctuation.

The 'C' language has a 32 bit (4 byte ) data word structure. We will be using ASCII (single byte values) for characters You are to fill in the 4 bytes of each integer with characters from your name. This means you need to have 4 characters in each 'C' integer word. Please note that INTEL architectures are little Endian.

The idea, is to have your program allocate a chunk of data via and array of integers. You are then to place the correct integers into the array (4 bytes at a time), and then end the final integer with a '0', because C uses the null character to indicate end of string.

Your program should have structure similar to:

main() {

int A[100]; char *S;

A[0]=XXXX; A[1]=YYYY;

...

A[n]=0; -- because C strings are terminated with NULL

...

printf("My name is %s ",S);

}

in c

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases And Information Systems 1 International Baltic Conference Dbandis 2020 Tallinn Estonia June 19 2020 Proceedings

Authors: Tarmo Robal ,Hele-Mai Haav ,Jaan Penjam ,Raimundas Matulevicius

1st Edition

303057671X, 978-3030576714

More Books

Students also viewed these Databases questions

Question

Draw up a list of the respective pros and cons of licensing.

Answered: 1 week ago

Question

LO 6-4 How to design brochures.

Answered: 1 week ago

Question

a. How do you think these stereotypes developed?

Answered: 1 week ago

Question

7. Describe phases of multicultural identity development.

Answered: 1 week ago