Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 26-08-2009
Member
 
Join Date: Aug 2009
Posts: 54
Unmodifiable variable even after changes in C programming

I have a small piece of code written in C language. In that code I have a variable named "k" whose value I want to modify but here is the problem. According to my program, the value of k should be changed but it doesn't changes at all. I thought of displaying the value of k after each changes so that I can keep track of its value. I noticed that after first statement and printing k, the value was 50. Now I have the statement where k changes to product of other 2 numbers and the result is assumed to be 560 but when I print k, the value remains 50. Why is that so? Why my k is unmodifiable even after changes?
Reply With Quote
  #2  
Old 26-08-2009
Member
 
Join Date: Apr 2008
Posts: 2,001
Re: Unmodifiable variable even after changes in C programming

What are you changing global k variable or local k variable? If your global k variable is having value of 50 and if you are changing the local k value then it is not possible. A global variable is a variable that is accessible in every scope. A local variable is a variable that is given in local scope.
Reply With Quote
  #3  
Old 26-08-2009
Member
 
Join Date: Apr 2008
Posts: 1,948
Re: Unmodifiable variable even after changes in C programming

This could be the problem of less RAM. How of memory are having? If you have appropriate memory then it might occur if you have used too much of variable among which some are now useless but they are still not released. Try to release them by using "free ()". If this is not the case then increase your computer RAM.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Unmodifiable variable even after changes in C programming"
Thread Thread Starter Forum Replies Last Post
Scope of Object or variable in Object oriented Programming Languages Dfrim Software Development 3 08-01-2011 06:20 AM
Runtime Error 91 : Object Variable or with block variable not set Ryan21 Software Development 2 28-08-2009 07:51 PM
What is Global Variable static? Declaring static variable instead of Global variable Reckon Software Development 3 25-04-2009 11:34 AM
Can we use static variable in other programming languages FlayoFish Software Development 2 25-04-2009 10:56 AM
JetBrains Introduces a New Programming Paradigm With its Meta Programming System JoeFrat Software Development 3 13-12-2008 01:49 PM


All times are GMT +5.5. The time now is 01:58 PM.