You have an int array with n elements and a structure with
three int members.
ie
struct No
{
unsigned int no1;
unsigned int no2;
unsigned int no3;
};
Point1.Lets say 1 byte in the array element is represented
like this - 1st 3 bits from LSB is one number, next 2 bits
are 2nd no and last 3 bits are 3rd no.
Now write a function, struct No* ExtractNos(unsigned int *,
int count)
which extracts each byte from array and converts LSByte in
the order mentioned in point1.and save it the structure
no1, no2, no3.
in the function struct No* ExtractNos(unsigned int *, int
count), first parameter points to the base address of array
and second parameter says the no of
elements in the array.
For example: if your array LSB is Hex F7 then result no1 =
7, no2 = 2, no3 = 7. In the same way convert all the
elements from the array and save the result in array of
structure.
Answer Posted / vadivel t
Hi small mistake.
change the
printf("ELEMENT IN THE STRUCTURE \n", (i+1));
to
printf("ELEMENT IN THE STRUCTURE %d\n", (i+1));
Is This Answer Correct ? | 0 Yes | 2 No |
Post New Answer View All Answers
Why is a semicolon (;) put at the end of every program statement?
Why clrscr is used after variable declaration?
What is a stream?
Is c call by value?
a linearly ordered set of data elements that have the same structure and whose order is preserved in storage by using sequential allocation a) circular b) ordinary c) array d) linear list
What is a program flowchart?
Where is c used?
What is the code in while loop that returns the output of given code?
Explain what are run-time errors?
Explain can you assign a different address to an array tag?
what is bit rate & baud rate? plz give wave forms
Explain pointer. What are function pointers in C?
What is wrong with this program statement?
What is the use of function in c?
Given an array of 1s and 0s arrange the 1s together and 0s together in a single scan of the array. Optimize the boundary conditions?