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


Type: Posts; User: Philip Nicoletti

Page 1 of 80 1 2 3 4

Search: Search took 0.87 seconds.

  1. Replies

    Re: mfc dialog display problem

    Is your width a multiple of 4? Some systems require that you pad the BMP scan lines to make them a multiple of 4.
  2. Replies

    Re: logarithmic operation

    It looks like you are using a C style printf format to look at the value.
    Probably "%d" .. which is for integers ... use "%e"
  3. Re: not printing true message scanf skipping problem in c.

    You have name declared as an integer (and reading as an integer).
    I suspect you are not entering an integer value for name.
  4. Replies

    Re: [] Operator Overloading in C++

    Simple example:

    class MyClass

    const int & operator[](int i) const { return x[i]; }
    int & operator[](int i) { return x[i]; }
  5. Replies

    Re: rapidxml

    Just a note: By default, using istream_iterator<char> will throw out whitespaces, which might not be wanted:

    Example, if the file contains:

    <message>Hello World</message>

    the string will...
  6. Replies

    Re: rapidxml

    You can use a back_inserter to read the file in the method you are using.
    I would open in binary mode.

    void CInput::load(char *fullpath)
    ifstream file(fullpath,ios::binary); //...
  7. Re: char [] or char [large size] question

    You can use GetWindowTextLength() to get the length of the window text (or a larger value).
    See the documention.
  8. Re: Migrating code from VS2008 to VS2010

    The VS2010 version is correct. You can't change the values of a set
    since it could change the order of the elements.

    There are a couple of workarounds

    1) remove the element from the set and...
  9. Replies

    Re: eof not working properly?

    Generally, this method is always wrong (since eof() does not become true until after
    an attempt has been made to read past eof):

    while ( !f.eof() )
    std::getline(f, temp);

  10. Replies

    Re: Sparse Matrix Operations

    1) Since you are using std::vector, you will not need to
    do a "new" to increase the size of sum matrix. You can
    simply push_back() the element.

    2) As a first pass, I would choose a simple...
  11. Replies

    Re: Sparse Matrix Operations

    You have:

    for (int i = 0; i< a.nrElemente; i++)
    Elems el;
    cout << el.Linie << " " << el.Coloana << " " << el.Valoare << endl;
  12. Replies

    Re: -Need Help- Doubling Array(s)

    1) you are missing:

    #include <string>

    2) I am not up to date on the latest standard (I think the definition of POD changed) , but
    it seems like using memcpy on objects that contain a...
  13. Re: error C2106: '=' : left operand must be l-value

    Take a look at your code in post # 2, and consider what would happen if the variable one did not have a 'Q' in it (even assuming you used +=). 2kaud suggestion of using find bypasses these types of...
  14. Re: error C2106: '=' : left operand must be l-value

    Since the variable, two, has a length of zero, I think that you should use operator +=
  15. Replies

    Re: VS 2015 and standard headers


    #include <cmath>
  16. Replies

    Re: Variable for a member variable

    You can not copy classes that are derived from CObject (for the reason given in the error message).

    You should be able to use a pointer instead:

    CComboBox * m_cbtheme;

    m_cbtheme =...
  17. Re: Given an array that contains numbers from 1 to 1+n

    Say N = 10 .. The array will have the numbers 1 thru 11 (with one missing)

    1 + 2 + 3 + ... + 11 = 11(12)/2 = 66

    Sum the elements in your array. It will be less that 66, since one number is...
  18. Re: Given an array that contains numbers from 1 to 1+n

    I assume that this is homework, so I'll just give you some hints:

    For (a) : use the fact that : 1 + 2 + 3 + ... + (n+1) = (n+1)*(n+2)/2

    For (b) : do a binary search. Compare the array value at...
  19. Re: Discrete Fourier Transform Test Results

    1) I don't see how you get the output you posted with the code you posted.

    2) The main difference the two outputs seems to be that you divide by the number of points.
  20. Re: Extracting RGB values from Bitmap Image

    It should probably be:

    for(int i=0; i<width*bytesPerPixel; i+=bytesPerPixel) // width
    arrayB_2D[j][counter] = array_1D[offsetx + i+0];
  21. Re: Extracting RGB values from Bitmap Image

    You did not do anything about one of my comments. Look at the loop:

    for(int i=0; i<width*bytesPerPixel; i+=bytesPerPixel) // width
  22. Re: Extracting RGB values from Bitmap Image

    1) What do you mean by: "the program still does not work". Are values incorrect ? Does it crash ?

    2) you need to post your current code.
  23. Re: Extracting RGB values from Bitmap Image

    Some quick thoughts:

    1) you don't want to pass the unsigned** variable to the Allocate
    functions. Also, it is written inefficiently. You only need
    two calls to new. Re-written allocate and...
  24. Replies

    Re: Why is there an exception?

    delete [] s;

    What is "s" pointing to ? many times you increment the value of s.
  25. Re: How to design unordered_map's hash function for this case and another one?

    There are standard has functions for primitive types, you can just use them.
    Something like the following:

    struct AStarNodePair_hash
    std::size_t operator () (const AStarNodePair &...
Results 1 to 25 of 2000
Page 1 of 80 1 2 3 4

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)