Search:

Type: Posts; User: Sumone Unknon

Search: Search took 0.00 seconds.

  1. Replies
    10
    Views
    4,850

    Well yes that makes sense ... but if by memory...

    Well yes that makes sense ... but if by memory corruption means that some parts of allocated structures overlap and a garbage value is being printed, why is it always 0? and why is getch() not...
  2. Replies
    10
    Views
    4,850

    I changed the title from "Russian Roulette" to...

    I changed the title from "Russian Roulette" to "Josephus problem"

    Thanks for telling me the real name of the problem :)
  3. Replies
    10
    Views
    4,850

    Do you mean like this? new1 = (struct node*)...

    Do you mean like this?


    new1 = (struct node*) malloc( ( ( sizeof(struct node*) )*2 ) + 2);
  4. Replies
    10
    Views
    4,850

    Isn't a pointer always of size 2 bytes? I used...

    Isn't a pointer always of size 2 bytes?

    I used sizeof(struct node*) and got 2 bytes. Integer was also 2 bytes.

    So 2+2+2 = 6 bytes.

    EDIT:
    Also, in line 72, it must be malloc(6), changing 4...
  5. Replies
    10
    Views
    4,850

    Josephus problem

    Hi
    I am writing a program of Josephus problem in which each player kills next player and the person which is left is winner.
    For Example, for 5 players

    1 -- 2 -- 3 -- 4 -- 5

    Starting with 1,...
  6. Incorrect pointer conversion when accessing a[2][2] with *b.

    Hi

    When running following code, it gives correct output but a warning something like: "Incorrect Pointer Conversion"


    void main()
    {
    int a[2][2] = {{1,2}, {3,4}}, *b = &a;
Results 1 to 6 of 6