Search:

Type: Posts; User: Zeus_

Page 1 of 13 1 2 3 4

Search: Search took 0.01 seconds.

  1. Read laserlight's comment. The c_str() method in...

    Read laserlight's comment. The c_str() method in your usage is not the way it works or is supposed to work.
  2. #include "bits/stdc++.h" using namespace...

    #include "bits/stdc++.h"


    using namespace std;


    int main() {
    time_t Capture = time(0);
    char d [20];
    strftime(d, 20, "%c", localtime(&Capture)); // 25/05/2020 12:51:00
  3. Replies
    5
    Views
    146

    You can't compare using != in C.

    You can't compare using != in C.
  4. Replies
    2
    Views
    135

    I'm not sure I understand completely. I realised...

    I'm not sure I understand completely. I realised I was compiling without -D_GLIBCXX_DEBUG, after which, I get messages like (which is what I wanted):



    c:\programming\mingw\mingw...
  5. Replies
    2
    Views
    135

    Checking for runtime violations

    Hey. Is there a way I could enable runtime checking using some compilation flags for things like out_of_bounds access or signed integer overflow. Usually when I have such problems, my executable...
  6. 1, 3, 4, 12: The CppCoreGuidelines link is very...

    1, 3, 4, 12: The CppCoreGuidelines link is very informative. It's answered many of my questions since yesterday. The funny thing is that I had already downloaded this from the repository but forgot...
  7. Some questions on noexcept, constexpr, namespaces, etc.

    Trying to learn noexcept, constexpr, etc. in C++ which I've neglected learning for so long. It wasn't taught at school either (well, neither was most of actual C++ except cin and cout and the rest...
  8. B derives public-ly from A. That roughly saying...

    B derives public-ly from A. That roughly saying "B is of type A" AND "B has its own set of properties that may differ from A". Why don't you run the code yourself and check if b.x is 10? Is it 10...
  9. Well, these are your errors. Stupid ones. ...

    Well, these are your errors. Stupid ones.



    ||=== Build: Debug in Template (compiler: GNU GCC Compiler) ===|
    C:\Users\aryan\Desktop\Projects\Template\main.cpp||In function 'int main()':|...
  10. Even we really can't see how we can fix these...

    Even we really can't see how we can fix these errors in your program. More specifically, we don't see any errors in your program because you didn't even put the slightest bit of effort into posting...
  11. Replies
    11
    Views
    295

    You should start by learning what loops can do.

    You should start by learning what loops can do.
  12. Thread: Arrays

    by Zeus_
    Replies
    2
    Views
    186

    (1) You can google to find out. (2) You can...

    (1) You can google to find out.

    (2) You can use a 1D array (as 2D arrays and 1D arrays are fundamentally the same thing). You just need to do access arithmetic yourself, which is not something...
  13. Replies
    1
    Views
    243

    Library Implementation Guide

    Hey. I really like the code design and implementations of many libraries I've happened to come across. Everything looks so pure, if that's the right word. I'm looking forward to a career involving...
  14. Replies
    1
    Views
    168

    Well, what is your question? You gave us some...

    Well, what is your question? You gave us some good knowledge in history but forgot to state your problem. You pasted the code, removed the comments, saved it into your project in CB, and ran it. This...
  15. Note: I haven't looked at your entire code and am...

    Note: I haven't looked at your entire code and am replying just to this message.

    > char yourletter[0];

    This is an array of char of size 0. It's not something you want, do you? Because you can't...
  16. Replies
    5
    Views
    289

    Well, it's not really that simple. You're trying...

    Well, it's not really that simple. You're trying to read/write from memory that isn't yours (allocated by you for you). That's a big enough problem to cause a crash.
  17. Replies
    1
    Views
    179

    Instead of printing exhaustively using all your...

    Instead of printing exhaustively using all your variables, print the ones after checking that they are non-zero (if-else statements). Use arrays for representation of currency/bills, same for the...
  18. Replies
    16
    Views
    908

    I can see (on the "What's New?" page) that...

    I can see (on the "What's New?" page) that someone called garrystark has replied to something in this thread. When I actually try to find the message, it doesn't exist. Was the message deleted?
  19. Replies
    2
    Views
    131

    It's just a matter of style, I think.

    It's just a matter of style, I think.
  20. Yes, indeed. Just did some tests and I found that...

    Yes, indeed. Just did some tests and I found that RVO kicks back in when used as in the example you provided. The reference return from += is what causes the confusion and hence no RVO. I knew that...
  21. Replies
    12
    Views
    249

    calloc and malloc are the same thing. calloc just...

    calloc and malloc are the same thing. calloc just sets the integer to value 0. So, if you allocate using malloc, and peek at the value of the variable, it can be anything from INT_MIN to INT_MAX (for...
  22. Replies
    7
    Views
    219

    It will result in true when the bit corresponding...

    It will result in true when the bit corresponding (2^i) in channel is set to 1 (where, '^' denotes "raised to the power of" and not XOR). Otherwise, false.
  23. Trouble understanding some code related to std::move

    What's the difference between:

    1)


    inline Foo operator + (const Foo& L, const Foo& R) {
    return Foo(L) += R;
    }
  24. Replies
    16
    Views
    908

    Yeah, that's the one.

    Yeah, that's the one.
  25. Replies
    16
    Views
    908

    Is my reply (to #11) still stuck in the...

    Is my reply (to #11) still stuck in the moderation queue? It's been 12+ (ig) hours since I replied and I don't see it yet...
Results 1 to 25 of 307
Page 1 of 13 1 2 3 4