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 functions are used for dynamic memory allocation in c language?
Explain what is the best way to comment out a section of code that contains comments?
what is event driven software and what is procedural driven software?
Iam a B.Tech graduate and completed my engineering in 2009, from 2005 to 2009 and after that i had done nothing.Now i want to do job and get into BPO field . Friends give me suggestions as what to say in interview... if they ask me that what would you had done ... these many years without doing job ??????? pls urgent
Explain the use of fflush() function?
Is there any data type in c with variable size?
Explain how can I pad a string to a known length?
Write a C Program That Will Count The Number Of Even And Odd Integers In A Set using while loop
When we use void main and int main?
Can true be a variable name in c?
What is a double c?
What is a #include preprocessor?
The % symbol has a special use in a printf statement. Explain how would you place this character as part of the output on the screen?
What are identifiers and keywords in c?
Explain is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?