About 15,200 results
Open links in new tab
  1. oop - Mutable vs immutable objects - Stack Overflow

    Oct 18, 2008 · For low-level languages like C or C++, I prefer to use mutable objects to conserve space and reduce memory churn. In higher-level languages, immutable objects make it easier …

  2. Are basic data types in C mutable or immutable by default?

    May 31, 2013 · In fact, by assigning b and c to 0 and then later reassigning them to 1 and 2 respectively, you demonstrated that ints (and all data types in C that are not declared const …

  3. C++ mutable keyword - GeeksforGeeks

    Feb 13, 2022 · The keyword mutable is mainly used to allow a particular data member of const object to be modified. When we declare a function as const, the this pointer passed to function …

  4. c++ - immutable strings vs std::string - Stack Overflow

    May 27, 2010 · You can create an immutable string class in C++, and you can make it largely compatible with std::string—but you will still lose when comparing to a built-in string class with …

  5. Mutable or Immutable strings? : r/ProgrammingLanguages - Reddit

    Nov 19, 2021 · You have &str, an immutable reference to a dynamically sized string, and String, a heap-allocated string buffer. It's possible to dereference a String to get access to the &str it …

  6. Learn Objective-C: Mutable vs. Immutable Strings

    The main takeaway is that you should only use mutable when your changing the string itself. But you can change the variable with both mutable and immutable strings without compiler or …

  7. Reading 9: Mutability & Immutability - MIT OpenCourseWare

    Other objects are mutable : they have methods that change the value of the object. String is an example of an immutable type. A String object always represents the same string. …

  8. Are Strings Mutable In C? - ANSWERTICA

    Jan 26, 2025 · Now, when it comes to mutability, C strings have an interesting property – they are immutable. This means that once a string is created, its individual characters cannot be …

  9. Are your strings immutable? – Daniel Lemire's blog

    Jul 7, 2017 · In both C and C++, string constants (declared with the const qualifier) are immutable, but you can easily “cast away” the const qualifier, so the immutability is weakly enforced. In …

  10. c++ - Does the 'mutable' keyword have any purpose other than …

    'mutable' does not affect bitwise/logical constness at all. C++ is only bitwise const and the 'mutable' keyword can be used to exclude members from this checking. It is not possible to …

  11. Some results have been removed
Refresh