Question: 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 index. Please note little Endian.

when asking the user to input their name they would input their name as representation of ASCII value of the character

Using

int data[100];

char *Pointer;

example of how the array should look for each index

data[0]=(66) + (114 * 256) + (97 * 256 * 256) + (116 * 256 * 256 * 256);

data[1]= (32) + (85 * 256) + (0);

each index of the array is holding up to 4 characters so data[0] is holding Brat

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!