Thread: Updating data

  1. #1
    Banned
    Join Date
    Apr 2015
    Posts
    596

    Updating data

    Hi guys; this is last curious question that's really confusing me so much!

    once I write to my compiler
    Code:
     int x=10;
    Code:
     x=5;
    Code:
    x=7;
    then the last value of x is updated and the last updated value of x is the current value of x, but I'm wondering where does the value 5, 10 gone? is the PC deletes them? how's that really gone like magic?!

    should I as programmer concern how does the PC delete the previous values?!


    thanks alot for your help.

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    They become eraser dust.

    On a related note, when I flip my light switch to the "on" state, where does the "off" state go? is the House deletes them? how's that really gone like magic?!
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User catacombs's Avatar
    Join Date
    May 2019
    Location
    /home/
    Posts
    81
    Quote Originally Posted by RyanC View Post
    should I as programmer concern how does the PC delete the previous values?!
    This should be the least of your concerns.

  4. #4
    Registered User
    Join Date
    Apr 2019
    Posts
    808
    Quote Originally Posted by laserlight View Post
    On a related note, when I flip my light switch to the "on" state, where does the "off" state go? is the House deletes them? how's that really gone like magic?!
    depends do you shout abracadabra?

  5. #5
    Registered User
    Join Date
    Feb 2019
    Posts
    1,078
    It depends... if you are writing a daemon, 5 and 10 surely go to Hell... It is not garanteed they go to heaven if not a daemon... On FreeBSD all numbers go to hell...

  6. #6
    TEIAM - problem solved
    Join Date
    Apr 2012
    Location
    Melbourne Australia
    Posts
    1,907
    I believe that the resister that the value gets put on is replaced. Make sure that you get the polarity right, because electricity.

  7. #7
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    Quote Originally Posted by Click_here View Post
    I believe that the resister that the value gets put on is replaced. Make sure that you get the polarity right, because electricity.
    Nah, it is likely a capacitor instead of a resister; unless you mean the new memory using a memresistor tech.

    Memistor - Wikipedia

    Tim S.
    Last edited by stahta01; 06-01-2019 at 06:23 PM.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

  8. #8
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    RyanC should switch off his computer, and leave it off if he's this worried by previous states.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  9. #9
    TEIAM - problem solved
    Join Date
    Apr 2012
    Location
    Melbourne Australia
    Posts
    1,907
    Quote Originally Posted by stahta01 View Post
    Nah, it is likely a capacitor instead of a resister; unless you mean the new memory using a memresistor tech.

    Memistor - Wikipedia

    Tim S.
    Nope - I'm just helping our resident help vampire with some alternative facts.

  10. #10
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    > "should I as programmer"
    I've never seen you demonstrate that you're a programmer.

    Your "knowledge" is as basic as one would get from reading pop-cards out of a box of corn flakes.

    Just look at how many posts you have on just the NULL pointer FFS.

    Grok this.
    Code:
    enum state {
      NOOB,
      VAMPIRE,
      BANNED
    };
    
    int main ( ) {
      enum state RyanC = NOOB;
      int sillyposts = 0;
      while ( RyanC != BANNED ) {
        sillyposts++;
        if ( sillyposts > 100 ) {
          RyanC = VAMPIRE;
        } else if ( sillyposts > 200 ) {
          RyanC = BANNED;
        }
      }
    }
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  11. #11
    Banned
    Join Date
    Apr 2015
    Posts
    596
    Quote Originally Posted by laserlight View Post
    They become eraser dust.

    On a related note, when I flip my light switch to the "on" state, where does the "off" state go? is the House deletes them? how's that really gone like magic?!
    Ooop, where is it gone? there's no answer to that question ..really where does it go? not kidding I'm so seriously. so magic is play role? and how switching light related to saving memory? are we saving to the memory by light?!!!!!!

  12. #12
    Registered User
    Join Date
    Feb 2019
    Posts
    1,078
    Quote Originally Posted by RyanC View Post
    Ooop, where is it gone? there's no answer to that question ..really where does it go? not kidding I'm so seriously. so magic is play role? and how switching light related to saving memory? are we saving to the memory by light?!!!!!!
    It's forbiden knowledge for those who wasn't initiated. Only the wiser Great Electron and His holly acolytes should grasp such concepts. To allow unholly peopole to undestestand it is HERESY!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Object data not updating correctly
    By Jim Greer II in forum C++ Programming
    Replies: 2
    Last Post: 12-15-2013, 01:18 PM
  2. updating a specific data in the file
    By tosihiro2007 in forum C Programming
    Replies: 8
    Last Post: 03-17-2013, 06:23 PM
  3. Updating the Data on a Datagrid from the Datasource
    By AntV in forum C++ Programming
    Replies: 0
    Last Post: 07-22-2009, 12:15 PM
  4. Self-Updating Data Structures...
    By alvifarooq in forum C++ Programming
    Replies: 9
    Last Post: 06-04-2005, 06:12 AM
  5. saving and updating data
    By izimmer in forum C Programming
    Replies: 1
    Last Post: 04-26-2002, 05:08 AM

Tags for this Thread