Can anyone expln the below code main() { union bbb { struct { int a:1; int b:1; int c:1; int d:1; int e:1; int f:1; int g:1; int h:1; }aaa; char x; }; union...
The structure members are bit fields. Each member is having 1 bit assigned to it. And all bits have value 1 which means in all the 8 bits value 1 is stored. SO...
hi , it will store 1111 1111 which is -1 as negative nos are stored in 2 s compliment form . suganthi rams <ashvinistar@...> wrote: Can anyone expln...
i found this to be interesting http://www.parashift.com/c++-faq-lite/ ... __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free,...
Hi, The compiler looks only for the declaration but the linker looks for the definition. When u r compiling the code it checks the function is declared or...
hai i am unable to understand the unspecified behaviour of the statement a[i] = i++ int the followinf program segment int main() { int a[10],i; for (i = 0;i <...
hai i am unable to understand the following code. can anyone kindly explain me. int main() { int a[10], i; for (i =0;i<10;i++) a[i]=i++ } with regards ...
Hi 1 st iteration: i =0; a[0] = 0; then i is incremented to 1, so the value of i, after assigning a[0] to 0 is 1(note this) now 'i' is again incremented,...
You can analysis this way, but there is another possibility (actually possibilities)... We know that i++ returns the original value of 'i' and increment 'i' by...
hi one n all I went to an interview n I found this program as very very intersting but could not able to solve. so here is the program Reverse a string in a...
... /* reverse string in a buffer str: string buffer len: length of the string */ void revstr(char *str, int len) { int i; char a; for(i=0; i < len/2; i++) { a...
... Hmm...this is one I came up with, but it's horribly inefficient: /* reverse string in just one pass using no buffer note: very inefficient (rather stupid) ...
This is not a single traversal in the true sense. Infact for every "i" u r traversing the rest of the string. I thought of one efficient solution but not many...
Hi Manish, Push the complete string means n charachters and pop the complete strings which needs again n pop s? Then shudn't we say two traversals, Good...
hi manish, But in this solution when u r pushing into stack means u r using one more buffer(stack) to store, but the question raised is we should not use...
... The idea of using a stack hit me before but I had to laugh it off. Not that it was only outrageously inefficient as well but it would also violate the ...
Does using recursive function consider external buffer? #include <conio.h> void ReversePrint(const char *Text) { if (*Text) { ReversePrint(Text+1); ...
some one had replied with one correct solution to this problem /* program not tested */ void reverse_string(char* string) { int n = strlen(string); int i=0; ...
Yes u ppl r rt....... No doubt in some sense it means two traversal............. The other way of using the same idea is to use recursive fn calls (implicit...
hi yah strlen internally traverses the string but i consider this as a internal implemantataion detail of C and in general this solution is ok if we have the ...
Hi, strlen is one loop this is O(n) but looping twice strlen loops through searching for '\0' I don't think this shud be accepted as correct, what say ppl? ...