Search:

Type: Posts; User: smrtshrm

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    4
    Views
    598

    Ambiguity in XOR operation

    Provided that a & b are integers,

    Why this works for calculating XOR:


    a^b


    but this doesn't:
  2. Replies
    6
    Views
    803

    thanks for pointing it, I took the wrong channel.

    thanks for pointing it, I took the wrong channel.
  3. Replies
    6
    Views
    803

    why we can't know the size of a function? Read...

    why we can't know the size of a function? Read about stack frame and what happens when a function is called -> then it will be clear (if not then further discussion can lead to conclusion). ...
  4. What exactly is going inside the scanf function in this program?

    It is continuously taking the first input again and again (even if I am just pressing ENTER) - What exactly is scanf reading from the Stream?



    #include<stdio.h>
    int main()
    {
    ...
  5. nope!! I am still weak in c

    nope!! I am still weak in c
  6. "k" is just for indicating if the linked list...

    "k" is just for indicating if the linked list whether it contains odd or even number of terms, if odd then there will be only one middle element else two middle elements.
  7. here is my logic: pointer "two" walks with twice...

    here is my logic: pointer "two" walks with twice pace when compared to pointer "one", when pointer "two" reaches the end, pointer "one" reaches the mid. since bothe pointer "one" & "two" are...
  8. Logic seems to be correct but segmentation fault is occurring.

    Through this program I want to find the middle element of the linked list but it is not working:



    #include<stdio.h>
    #include<stdlib.h>
    struct node
    {
    int i;
    struct node *next;
  9. thanks for the help.

    thanks for the help.
  10. Different behavior encountered while printing array elements using %s & %c

    When I run this code:



    #include<stdio.h>
    int main()
    {
    char i[6];
    int k;
    fgets(i,15,stdin);
  11. Thanks for pointing me into right direction.

    Thanks for pointing me into right direction.
  12. Sizeof used to gauge no. of elements of array passed to function - dubious behaviour

    In this program, on using sizeof to compute no. of elements in array x, it works fine:



    #include<stdio.h>
    int main()
    {
    int x[5]={23,54,3,5,6};
    int...
  13. Thanks a lot. you have saved me from all the...

    Thanks a lot. you have saved me from all the confusion related to that algo :)
  14. You can understand pointers from...

    You can understand pointers from this:http://www.cs.cf.ac.uk/Dave/C/node10.html - little practice will be enough for clarity.

    If you are new to linked list then please try to break the code...
  15. Run this: Even declaration of num outside...

    Run this:

    Even declaration of num outside main() and fmax() will work.



    #include <stdio.h>
    #include <stdlib.h>
    //prototype
    int fmax(int a[], int n);
  16. Looks convincing, I'll try that and see if it...

    Looks convincing, I'll try that and see if it works.
  17. in main function declare int num; pass...

    in main function declare
    int num;

    pass array to the function fmax by sending the address of 1st element of array & access its elements with help of pointer -->

    Method:


    printf("Maximum:...
  18. Check the validity of this algorithm to convert infixt to postfix (precedence needed)

    Symbol <-----> In-Stack Priority <------> In-coming Priority
    +- <-----------------> 2 <-----------------> 1
    */ <-----------------> 4 <-----------------> 3
    ^ ...
  19. thanks a ton!!

    thanks a ton!!
  20. Why is this different working of code occurirng due to scanf?

    I have made a program for converting infix to postfix notation (provided not more than 2 operands and 1 operator may reside within single () ), the program takes first input as number of infix...
  21. I am using linux & the compiler is gcc.

    I am using linux & the compiler is gcc.
  22. any non-standard method which you can suggest?...

    any non-standard method which you can suggest? all I get is "implicit declaration of function ‘getch: undefined reference to `getch'
    collect2: error: ld returned 1 exit status’"
  23. Alternative for getch() as conio.h is not official

    If I use scanf() to read standard single character input then ENTER is needed to read next character, in case of getchar() it echoes the input on screen, is there anything which takes input without...
  24. Replies
    4
    Views
    1,753

    Lets say the file you have to read is T.txt, the...

    Lets say the file you have to read is T.txt, the methods for you to solve this problem is:

    Traverse the file, store the integer somewhere & while traversing insert each ASCII character into a...
  25. Replies
    3
    Views
    798

    What problem are you facing in designing the code?

    What problem are you facing in designing the code?
Results 1 to 25 of 35
Page 1 of 2 1 2