CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: tomy12

Page 1 of 7 1 2 3 4

Search: Search took 0.02 seconds.

  1. Re: Using containers list and vector in a program

    Is the window called Autos in the screenshot below where I ought to focus on and should I then expand the elements, e.g., d, d.line. is, here, for more concentration? I mean is it the proper method...
  2. Re: Using containers list and vector in a program

    And by using the debugger the intention is to run and follow the control in the code by F10 & F11 in VS, right?

    I'm sorry that I can't give you a Rate! That system gives me a message to spread...
  3. Re: Using containers list and vector in a program

    Ow ****, ln->begin() equals lines.begin()->begin() that is, it pointes to the first element (char) of the vector, and ln->end() points to one beyond the last element in the current vector not the...
  4. Using containers list and vector in a program

    Hi all,

    Here's a code using a list of vectors to read a text terminated by ctrl+z and then print it all in the same order. The problem is that I don't know why is the function Text_iterator&...
  5. Replies
    14
    Views
    976

    Re: My simple vector crashes

    Ah, **** it! Three thousand lines of code for a vector!? :(
  6. Replies
    14
    Views
    976

    Re: My simple vector crashes

    @2kaud

    You're using Visual Studio 2019 compiler just like me. I want to find the source code of STL libraries inside it so that I can explore them at times I need but whatever I search I'm not...
  7. Replies
    14
    Views
    976

    Re: My simple vector crashes

    Thank you very much for your help.
  8. Replies
    14
    Views
    976

    Re: My simple vector crashes

    2 questions:

    1) Why did you change:

    myVec(const int&); // Ordinary constructor
    myVec(initializer_list<T>); // Initializer list constructor

    to
  9. Replies
    14
    Views
    976

    Re: My simple vector crashes

    @VictoeN
    I recalled that method and using F10 and F11 tried to go through the code step by step to find the line containing the error but yet nothing except for the message above. I run my program...
  10. Replies
    14
    Views
    976

    Re: My simple vector crashes

    I run my programs in Debug mode using VS 2019 with C++ 17 enabled.
    I added #include <initializer_list> but still get the run-time error message which is saying: HEAP CORRUPTION DETECTED, but I don't...
  11. Replies
    14
    Views
    976

    My simple vector crashes

    Hi all,

    Here is the first version of my vector. It crashes and presumably the reason is the initializer list constructor, but I've used the version written in the Programming Principles and...
  12. Replies
    9
    Views
    1,476

    Re: Rvalue reference and move semantics

    If we still consider v.push_back(A(25)); only, in the move constructor, we have:

    // Move constructor.
    A(A&& other) : mData(nullptr), mLength(0)

    What are those mData and mLength which are...
  13. Replies
    9
    Views
    1,476

    Re: Rvalue reference and move semantics

    When I use main() this way:


    vector<A> v;
    v.push_back(A(25));
    // v.push_back(A(75));

    // Insert a new element into the second position of the vector.
    // v.insert(v.begin()...
  14. Replies
    9
    Views
    1,476

    Re: Rvalue reference and move semantics

    When I run the code by F10 on VS 2019, I see that all of the following three A's member functions are called when v.push_back(A(25)); is done:

    1) constructor, on line 7
    2) move constructor on...
  15. Replies
    9
    Views
    1,476

    Re: Rvalue reference and move semantics

    Thanks so much dear 2Kaud for your nice explanation. :)


    I tested the first push: v.push_back(A(25));. On this line, firstly the class's constructor is called, for the temp object, and then the...
  16. Replies
    9
    Views
    1,476

    Rvalue reference and move semantics

    Hi all,

    I'm trying to study rvalue reference and move semantics using this tut. In the How it works section of that page, it says: Both push_back() calls resolve as push_back(T&&) because their...
  17. Replies
    2
    Views
    535

    How to make a loop run until end

    Hi,

    consider here we press an alphabetical character, how to simply ignore that and get the look to work until end, please?


    int main()
    {
    vector<int> v;
    int n = 15, m;
  18. Replies
    0
    Views
    2,100

    C++ and socket programming

    Hello all,

    It's days I'm dealing with this question and haven't reached a conclusion to make a decision and start learning socket programming.
    I know C++ to a some extent and it's very exciting...
  19. Replies
    2
    Views
    594

    Default values for a user-defined types

    Hi all,

    Please consider this snipped-code:


    int main()
    {
    cout << int() << endl;
    return 0;
    }
  20. Re: How to implement the count function of algorithm ourselves

    Thank you very much.
  21. Re: How to implement the count function of algorithm ourselves

    The return type of the function is something vague for me, typename iterator_traits<InputIterator> :: difference_type, but what I've returned is of integer (i).
  22. Re: How to implement the count function of algorithm ourselves

    I changed the whole code to this:


    #include <C:\Users\Abbasi\Desktop\std_lib_facilities_4.h>
    using namespace std;

    template<typename InputIterator, typename Type>
    typename...
  23. Re: How to implement the count function of algorithm ourselves

    trains was a mistake in place of the right choice traits!
    It's the content of that header file.

    Now the errors are different:

    1- Severity Code Description Project File Line Suppression...
  24. How to implement the count function of algorithm ourselves

    Hi,

    Exercise 3 of chapter 21 of the book Programming Principles and Practice Using C++ says:
    Implement count yourself and test it.

    I sought it and found the declaration of that function:

    ...
  25. Replies
    9
    Views
    1,526

    Re: Function objects

    This is the code:


    #include <C:\Users\Abbasi\Desktop\std_lib_facilities_4.h>
    using namespace std;

    int i = 0;
    struct No_case { // is lowercase(x) < lowercase(y)?

    bool operator()(const...
Results 1 to 25 of 175
Page 1 of 7 1 2 3 4


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)