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
Multiply an Integer Number by 2 Without Using Multiplication Operator
How can I remove the trailing spaces from a string?
Explain union. What are its advantages?
Are the variables argc and argv are always local to main?
Can we replace the struct function in tree syntax with a union?
In this problem you are to write a program that will cut some number of prime numbers from the list of prime numbers between 1 and N.Your program will read in a number N; determine the list of prime numbers between 1 and N; and print the C*2 prime numbers from the center of the list if there are an even number of prime numbers or (C*2)-1 prime numbers from the center of the list if there are an odd number of prime numbers in the list.
Write a program to generate the Fibinocci Series
Can a pointer be null?
What are the types of type specifiers?
Write a program to display all the prime nos from 1 to 1000000, your code should not take time more than a minute to display all the nos.
Can static variables be declared in a header file?
Which is best book for data structures in c?
In the DOS enveronment, normal RAM that resides beyond the 1mb mark. a) expanded memory b) swapped memory c) Extended memory d) none
What is double pointer in c?
write a programming in c to find the sum of all elements in an array through function.