C variable

This is a discussion on C variable within the C Programming forums, part of the General Programming Boards category; Hi, I wanted to use a variable which is not initially assigned to any value, but later in program i ...

  1. #1
    Registered User
    Join Date
    Oct 2008
    Posts
    2

    C variable

    Hi,

    I wanted to use a variable which is not initially assigned to any value, but later in program i want to assign it to zero and than increment it and return the updated value to the same variable,

    It would look like this
    Code:
    function()
    {
        int variable;
              .
              .
       variable =0; 
    /* I cannot do this because this is actually a header file and will be continuously called, and hence i cannot use the updated value of this variable */
    
            .
            .
            .
    variable++;
    return(variable);
    }  /* end of function */

  2. #2
    Registered User
    Join Date
    Oct 2008
    Posts
    2

    got it

    I found the way, thank you

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How accurate is the following...
    By emeyer in forum C Programming
    Replies: 22
    Last Post: 12-07-2005, 11:07 AM
  2. Use of variable
    By alice in forum C Programming
    Replies: 8
    Last Post: 06-05-2004, 07:32 AM
  3. Replies: 2
    Last Post: 04-12-2004, 01:37 AM
  4. write Variable and open Variable and get Information
    By cyberbjorn in forum C++ Programming
    Replies: 2
    Last Post: 04-09-2004, 01:30 AM
  5. Variable question I can't find answer to
    By joelmon in forum C++ Programming
    Replies: 3
    Last Post: 02-12-2002, 03:11 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21