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

Search:

Type: Posts; User: tomy12

Page 1 of 8 1 2 3 4

Search: Search took 0.02 seconds.

  1. Re: How to use the TEA Algorithm to deal with human readable text

    @VictorN: Isn't it because of your using std::hex by outputting?
    I agree, but when commenting it the output contains only numbers this time. :|


    @2Kaud: What are expecting the output file to...
  2. How to use the TEA Algorithm to deal with human readable text

    Here's my TEA algorithm that I like to use for dealing with texts that humans can understand, i.e., English characters.


    #include <iostream>
    #include <string>
    #include <fstream>
    #include...
  3. Replies
    7
    Views
    1,898

    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...
  4. Replies
    7
    Views
    1,898

    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...
  5. Replies
    7
    Views
    1,898

    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...
  6. Replies
    7
    Views
    1,898

    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&...
  7. Replies
    14
    Views
    2,613

    Re: My simple vector crashes

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

    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...
  9. Replies
    14
    Views
    2,613

    Re: My simple vector crashes

    Thank you very much for your help.
  10. Replies
    14
    Views
    2,613

    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
  11. Replies
    14
    Views
    2,613

    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...
  12. Replies
    14
    Views
    2,613

    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...
  13. Replies
    14
    Views
    2,613

    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...
  14. Replies
    9
    Views
    1,776

    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...
  15. Replies
    9
    Views
    1,776

    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()...
  16. Replies
    9
    Views
    1,776

    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...
  17. Replies
    9
    Views
    1,776

    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...
  18. Replies
    9
    Views
    1,776

    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...
  19. Replies
    2
    Views
    3,973

    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;
  20. Replies
    0
    Views
    4,364

    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...
  21. Replies
    2
    Views
    892

    Default values for a user-defined types

    Hi all,

    Please consider this snipped-code:


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

    Thank you very much.
  23. 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).
  24. 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...
  25. 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...
Results 1 to 25 of 177
Page 1 of 8 1 2 3 4





Click Here to Expand Forum to Full Width

Featured