Thread: changing parameter of a function..

  1. #1
    Banned
    Join Date
    Oct 2008
    Posts
    1,535

    changing parameter of a function..

    if i have a root in the signature of a function what has
    int value
    node* next
    in it

    can i use func( node *root) here in order to change the value integer
    or func( node **root)
    ??

  2. #2
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    I wonder, how it came that having more than 1000 posts you still cannot write a questing to be understand by others?

    if you have a struct
    Code:
    struct node
    {
       int value;
       struct node* next;
    };
    to change a value enough to pass pointer to struct

    void func(struct node* current);
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

  3. #3
    Banned
    Join Date
    Oct 2008
    Posts
    1,535
    but it changes the value of the parameter
    we need **

  4. #4
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    Quote Originally Posted by transgalactic2 View Post
    but it changes the value of the parameter
    we need **
    If you know better, why do you still ask questions? Stop spamming
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

  5. #5
    Banned
    Join Date
    Oct 2008
    Posts
    1,535
    i know that we cant change the parameter thats why we use

    ** root

    so we use it when we what to change the address of the root

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 28
    Last Post: 07-16-2006, 11:35 PM
  2. Bisection Method function value at root incorrect
    By mr_glass in forum C Programming
    Replies: 3
    Last Post: 11-10-2005, 09:10 AM
  3. Change this program so it uses function??
    By stormfront in forum C Programming
    Replies: 8
    Last Post: 11-01-2005, 08:55 AM
  4. Replies: 3
    Last Post: 03-04-2005, 02:46 PM