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 6195You 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 5584
Are local variables initialized to zero by default in c?
How #define works?
What is the process to create increment and decrement stamen in c?
What is the difference between local variable and global variable in c?
How can you invoke another program from within a C program?
What are 3 types of structures?
write a program which the o/p should b in such a way that s triangle if I/p is 3,a Square/rectangle if I/P=4,a pentagon if I/P=5 and so on...forget about the I/P which is less than 3
I need a sort of an approximate strcmp routine?
Why do we need arrays in c?
Which of these functions is safer to use : fgets(), gets()? Why?
in linking some of os executables are linking name some of them
Why does this code crash?
In C language, a variable name cannot contain?
Why is void main used?
How do you construct an increment statement or decrement statement in C?