can we declare a function inside the structure? ex: struct book { int pages; float price; int library(int,float); }b; is the above declaration correct? as it has function declaration?
2 6289You 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.
2 5691
In which language linux is written?
How can I pad a string to a known length?
Can a pointer be null?
Explain what is the difference between text files and binary files?
What are comments and how do you insert it in a C program?
What is the translation phases used in c language?
What does %2f mean in c?
difference between native and cross compilers
What is the use of header files?
write a program to find out prime number using sieve case?
What is hash table in c?
What is hashing in c language?
Which is not valid in C a) class aClass{public:int x;}; b) /* A comment */ c) char x=12;
What is the use of getch ()?
What is the difference between abs() and fabs() functions?