Quantcast

Got Homework?

Connect with other students for help. It's a free community.

  • across
    MIT Grad Student
    Online now
  • laura*
    Helped 1,000 students
    Online now
  • Hero
    College Math Guru
    Online now

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

Mandy_Nakamoto

what does static array means in c programming????

  • 2 years ago
  • 2 years ago

  • This Question is Closed
  1. UnexpectedEOF
    Best Response
    You've already chosen the best response.
    Medals 0

    In the context of C, the keyword "static" means that the value of a variable/pointer is saved from deletion in certain instances. Static arrays are a kind of static variable, and are set to null when declared (see http://stackoverflow.com/questions/553213/c-static-array). Example of a static var inside a function: By declaring a static variable (let's say it's an int and declared "int mystaticvar") inside a function, I can call the function multiple times and each time the value of mystaticvar would be whatever it was at the end of the previous call. Example: -I call the function myFunc() and inside it the variable mystaticvar is declared to be 0. myFunc then sets the value of mystaticvar to 1. myFunc() returns, and all other non-static vars are eliminated. -I call myFunc again, and now mystaticvar's value is 1 before I do anything with it! Hope this helps!

    • 2 years ago
  2. Mandy_Nakamoto
    Best Response
    You've already chosen the best response.
    Medals 0

    thank you..^^

    • 2 years ago
  3. Mandy_Nakamoto
    Best Response
    You've already chosen the best response.
    Medals 0

    but it says static.. i thought it means by constant.. so the value still change???

    • 2 years ago
  4. agdgdgdgwngo
    Best Response
    You've already chosen the best response.
    Medals 0

    The true meaning/purpose of the keywords in C or C-like languages greatly differ from their English meaning :-D

    • 2 years ago
  5. benjica
    Best Response
    You've already chosen the best response.
    Medals 0

    Static in this case means that the variable retains definition and declaration even when it's scope is released. Calls can still be made to change the value of the variable. It isn't lost when the scope concludes. Constant implies the value never changes.

    • 2 years ago
  6. Mandy_Nakamoto
    Best Response
    You've already chosen the best response.
    Medals 0

    @benjica scope???

    • 2 years ago
  7. DerrickDotEl
    Best Response
    You've already chosen the best response.
    Medals 1

    static does not need to be instantiated.

    • 2 years ago
    • Attachments:

See more questions >>>

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.