User Profile

Collapse

Profile Sidebar

Collapse
blackslither
blackslither
Last Activity: Feb 24 '10, 05:36 AM
Joined: Oct 25 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • blackslither
    started a topic Game Of Life 3D
    in C

    Game Of Life 3D

    I had to implement Game of Life in a 3D matrix (int a[ ][ ][ ]) , but the complexity of my implementation is O(n^6) (6 imbricated for) and it runs very slow . Can anyone help me with an optimized version of Game of life , even with a 2D matrix . Or how the Game of Life in general could be optimized ?
    See more | Go to post

  • got it 10x , correct me if i'm wrong .. .....

    void change(int **x, int **y){*x=*y;}

    int main(){
    int *xx,*yy;

    yy = (int*)malloc(si zeof(int));
    change(&xx,&yy) ;

    if(xx == NULL)printf("is null\n");
    else printf("---- %d ----\n",*xx);...
    See more | Go to post

    Leave a comment:


  • change(int*x , int* y){*x=*y;}

    main(){
    int x,y;
    y=7;
    change(&x,&y);
    }

    to be similar to the one with pointers , i would do it this way...
    See more | Go to post

    Leave a comment:


  • then how can i copy the value of one pointer argument into another pointer argument ?

    xx = yy must be done in a function . the original program is much complex and it has to be done that way .
    See more | Go to post

    Leave a comment:


  • blackslither
    started a topic hi , i'm having a problem with pointers in C ...
    in C

    hi , i'm having a problem with pointers in C ...

    I will give a simple example inspired from my problem :

    void change(int *x, int *y){x=y;}

    int main(){
    int *xx,*yy;

    yy = (int*)malloc(si zeof(int));
    change(xx,yy);

    if(xx == NULL)printf("is null\n");
    else printf("---- %d ----\n",*xx);

    ............... ............... ............... ..............

    xx doesn't...
    See more | Go to post
No activity results to display
Show More
Working...