Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What are keywords in c with examples?

1079


What is a constant and types of constants in c?

1114


What is the package for freshers(Non IIT) in amazon(hyderabad). And what is the same for those who are a contract employee.

4281


What are c identifiers?

1087


Explain what is wrong with this program statement? Void = 10;

1256


How can I generate floating-point random numbers?

1125


What are actual arguments?

1083


What is difference between array and pointer in c?

1082


What is #include stdio h and #include conio h?

1101


What are external variables in c?

1097


What is string constants?

1143


What are the usage of pointer in c?

1193


What is a void pointer in c?

1105


What is null pointer in c?

984


I came across some code that puts a (void) cast before each call to printf. Why?

1218