Write a program that compares two files and return 0 if they are equal and 1 if they are not equal.
Latest Answer: int main(int argc, char* argv[]) { if(argc!=3) return -1; FILE *fp1, *fp2; fp1 = fopen(argv[1],"r"); fp2 = fopen(argv[2],"r"); if(!fp1 || !fp2) return -1; while(fgetc(fp1) == fgetc(fp2) && ...
When reallocating memory if any other pointers point into same piece of memory do you have to readjust these pointers or do they get readjusted automatically?
Latest Answer: If any pointers are pointing to the old memory location they have to be adjusted. C won't do it for you ...
What is the maximum length of command line arguments including space between adjacent arguments ?
Latest Answer: It can compile 200 words of length. ...
what is a bss data segment?
Latest Answer: BSS, a part of Data Segment store all variables initialized to 0. static variable(initialized with value other than 0) are not stored in BSS.Actually BSS is an "Uninitialized RAM" which is initialized to 0 before executing main(). ...
which type of memory(stack or heap)is used by static and external variables?
Latest Answer: Static variables use stack memory. ...
w.a.p in C to input a word. find the total no. of letters forming the word. and using these letters display the total no. of possible combinations without repeating any letter.for example:
Latest Answer: #include #include char a[10]; int i,j,k; void one(); void two(); void three(); void main() { printf("n enter a word "); gets(a); ...
What is the requirment of using fflush() in multiple scanf calls.
Latest Answer: When we take some name, age, class from user using scanf then at first when we take name and after age then some time the age place is skip and user can not assigned any value there. Reason behind it only is buffer. After giving name by user there some ...
Write a program to read a file, strip the comments and write the output to another file.
Latest Answer: #include#include#includeenum ParseState { INITIAL, ONE_SLASH_READ, TWO_SLASHES_READ, ONE_SLASH_STAR_READ, ONE_SLASH_STAR_AND_STAR_READ } CommentParseState;StripComment(){ FILE ...
Explain the virtual table generated in memory at the time of declaration of virtual function?
Latest Answer: In C++ there is the concept of virtual functions. The resolution of these functions takes place at run time. A V table is used for this purpose. ...
What is the slack memory concept in allocation of structure memory?
Latest Answer: I think slack memory is the extra memory at the end of a structure which may go unused. It may also include unused memory within a struct. For example, if a struct includes a short and then an int, in that order, the int needs to be on a 4-byte boundary ...
View page << Previous 1 [2] 3 4 5 6 7 8 9 10 Next >>

Go Top