Thread: Overwriting

  1. #16
    Registered User
    Join Date
    Dec 2017
    Posts
    1,626
    RyanC, nobody is this stupid.
    You are a troll.
    Get lost.
    A little inaccuracy saves tons of explanation. - H.H. Munro

  2. #17
    Banned
    Join Date
    Apr 2015
    Posts
    596
    Quote Originally Posted by john.c View Post
    RyanC, nobody is this stupid.
    You are a troll.
    Get lost.
    Excuse me? that's something really weird how pc works, why are you saying that's I'm trolling?!

  3. #18
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    Quote Originally Posted by RyanC View Post
    Excuse me? that's something really weird how pc works, why are you saying that's I'm trolling?!
    Because the assignment statement is one of the first thing most people learn in programming!

    And, you say you do not understand it; so, you are either a very ignorant newbie, a troll, or a help vampire.

    Tim S.
    "...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

  4. #19
    Banned
    Join Date
    Apr 2015
    Posts
    596
    Quote Originally Posted by stahta01 View Post
    Because the assignment statement is one of the first thing most people learn in programming!

    And, you say you do not understand it; so, you are either a very ignorant newbie, a troll, or a help vampire.

    Tim S.
    To learn? I can said that I learnt it, but need to understanding what's going in term of "overwriting" , where's the problem on? I can be a good programmer and just say overwrite=delete without knowing what's going inside pc itself !

    Additionally, let's assume Im a very ignorant newbie, isn't the forum based on helping others?!


    thanks anyway.
    Last edited by RyanC; 12-05-2018 at 12:32 PM.

  5. #20
    Programming Wraith GReaper's Avatar
    Join Date
    Apr 2009
    Location
    Greece
    Posts
    2,739
    Them being or not a troll is irrelevant. The fact is, the questions presented might as well be legit, and they make you think too. I had never sat down to think what assignment truly is, because it's rather intuitive to me. Maybe it isn't so intuitive for everyone...
    Devoted my life to programming...

  6. #21
    Banned
    Join Date
    Apr 2015
    Posts
    596
    Quote Originally Posted by GReaper View Post
    Them being or not a troll is irrelevant. The fact is, the questions presented might as well be legit, and they make you think too. I had never sat down to think what assignment truly is, because it's rather intuitive to me. Maybe it isn't so intuitive for everyone...
    Yup ! exactly, btw it's intuitive also for me .. just I'm curious about .. nothing else !

  7. #22
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Quote Originally Posted by RyanC
    When I write i=0 and afterwards i=5; the recent number of i is the value of it; but why? What's going on pc exactly? is it a property of pc to overwrite? If so how is it going?
    (...)
    I couldn't imagine the process of how pc doing that!.. I guess he delets data first and then write
    I can understand why Kernelpanic, john.c, and stahta01 think you're trolling: from the perspective of C programming, your question sounds inane as it should be obvious that the value of i is overwritten by the assignment, and then because assignment is an atomic operation ("atomic" as in "indivisible"), guessing that "he delets data first and then write" surely is a poor guess.

    At the same time, by your mentioning of "property of pc" and "how pc doing that", it sounds to me that you have in mind what is going on in hardware rather than from the perspective of C programming. This means introducing things like registers, CPU caches, random access memory, and then more permanent and abundant storage like platter-based hard disk drives and solid state drives.

    We could very well say that perhaps i corresponds to a register, so "what's going on pc exactly" is that the flip-flops of the register are changed in state to reflect the bit pattern of the number 5. So for an analogy you don't need cake: just imagine a flippable light switch for on-off, and what's happening is that if you want to set it to "on", it's flipped one way, and for "off", it's flipped the other way, and then you have a whole bunch of them such that in a particular off-off-off-off-off-on-off-on ordering they represent the number 5.
    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

  8. #23
    Banned
    Join Date
    Apr 2015
    Posts
    596
    Quote Originally Posted by laserlight View Post
    I can understand why Kernelpanic, john.c, and stahta01 think you're trolling: from the perspective of C programming, your question sounds inane as it should be obvious that the value of i is overwritten by the assignment, and then because assignment is an atomic operation ("atomic" as in "indivisible"), guessing that "he delets data first and then write" surely is a poor guess.

    At the same time, by your mentioning of "property of pc" and "how pc doing that", it sounds to me that you have in mind what is going on in hardware rather than from the perspective of C programming. This means introducing things like registers, CPU caches, random access memory, and then more permanent and abundant storage like platter-based hard disk drives and solid state drives.

    We could very well say that perhaps i corresponds to a register, so "what's going on pc exactly" is that the flip-flops of the register are changed in state to reflect the bit pattern of the number 5. So for an analogy you don't need cake: just imagine a flippable light switch for on-off, and what's happening is that if you want to set it to "on", it's flipped one way, and for "off", it's flipped the other way, and then you have a whole bunch of them such that in a particular off-off-off-off-off-on-off-on ordering they represent the number 5.
    very good explanation, I appreciate your answer very much, I guess once again because it's really harassed me once they said I'm a troll, lets see who will be a good programmer at the end

    thanks!

  9. #24
    Registered User
    Join Date
    Dec 2017
    Posts
    1,626
    Hey troll!
    I'm already a good programmer.
    All evidence suggests that you will never be a good programmer.
    Stop harassing people with your thoughtless childish questions.
    A little inaccuracy saves tons of explanation. - H.H. Munro

  10. #25
    Banned
    Join Date
    Apr 2015
    Posts
    596
    Quote Originally Posted by john.c View Post
    Hey troll!
    I'm already a good programmer.
    All evidence suggests that you will never be a good programmer.
    Stop harassing people with your thoughtless childish questions.
    get lost

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Am I overwriting my linked list?
    By roud9 in forum C Programming
    Replies: 2
    Last Post: 12-03-2015, 10:20 PM
  2. array value overwriting another
    By RyanW2050 in forum C Programming
    Replies: 2
    Last Post: 01-27-2012, 01:34 AM
  3. Overwriting all in array, why?
    By guesst in forum C Programming
    Replies: 7
    Last Post: 10-09-2008, 05:56 PM
  4. Overwriting a character
    By WanTeD in forum C Programming
    Replies: 3
    Last Post: 05-12-2003, 04:36 AM
  5. Writing to a file without overwriting
    By Unregistered in forum C++ Programming
    Replies: 2
    Last Post: 04-10-2002, 09:21 PM

Tags for this Thread