darek9576's Profile User Rating: ***--

Reputation: 202 Stalwart
Active Members
Active Posts:
1,704 (0.84 per day)
13-March 10
Profile Views:
Last Active:
User is offline Yesterday, 11:37 AM

Previous Fields

Dream Kudos:
Icon   darek9576 has not set their status

Posts I've Made

  1. In Topic: std::deque confusion

    Posted 28 Sep 2015

    Thanks. I have changed the optimization settings and i am getting the results that look more or less like yours.
  2. In Topic: std::deque confusion

    Posted 27 Sep 2015

    Not sure if we have the same settings, but this is my output:

    Vector took: 8758 milliseconds.
    Deque (double ended queue) took: 47196 milliseconds.

    Can i change somehow my settings to match your output.
  3. In Topic: When object variables "overwrite" eachother

    Posted 24 Aug 2015

    You might check out static members. Instance variables will always be specific to an object.
  4. In Topic: missing template arguments before

    Posted 23 Aug 2015

    This does not answer your question, but if you have access to Boost libraries, you could use boost::algorithm::to_upper() or boost::algorithm::to_upper_copy() functions as the following:

    #include <vector>
    #include <boost/algorithm/string.hpp>
    void boostExample(){
    	std::vector<std::string> words = { "this", "is", "a", "lower", "case", "sentence" };
    	std::for_each(std::begin(words), std::end(words), [](const std::string & e) { 
    		std::cout << boost::algorithm::to_upper_copy(e) << " "; }
  5. In Topic: Help with finding the sum of odd numbers using an array

    Posted 5 Aug 2015

    bool isOdd(int x) {
      if(x%2 != 0)
        return true;
    bool isEven(int x) {
      if(x%2 == 0)
        return true;

    What if those if statements return false. You need to return a boolean value on every execution path.

    I also do not think you are allowed to use std::array<> or std::vector<> but if you were, then you could do:

    std::vector<int> numbers = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
    int sum = 0;
    std::for_each(std::begin(numbers), std::end(numbers), [&sum](const int & element){ if (element % 2 != 0) sum += element; });
    std::cout << "The sum of odd elements is: " << sum << std::endl;

My Information

Member Title:
D.I.C Lover
Age Unknown
Birthday Unknown

Contact Information

Click here to e-mail me


darek9576 hasn't added any friends yet.


darek9576 has no profile comments yet. Why not say hello?