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
What is graph in c?
How many types of errors are there in c language? Explain
What is file in c language?
write a proram to reverse the string using switch case?
What is main function in c?
What is scope rule of function in c?
hi friends how r u as soon in satyam my interview is start but i m very confusued ta wat i do plz help me frndz wat can i do plz tell me some question and answers related with "C" which r asked in the interview .
What are global variables and how do you declare them?
What does void main () mean?
What is conio h in c?
What is meant by keywords in c?
Differentiate between Macro and ordinary definition.
Where can I get an ansi-compatible lint?
Write a program to input the price of 1 burger and the number of burgers eaten by a group of friends .print the total amount to be paid by the group?
What is a const pointer in c?