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

Search:

Type: Posts; User: Philip Nicoletti

Page 1 of 80 1 2 3 4

Search: Search took 0.55 seconds.

  1. Replies
    20
    Views
    616

    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);


    Normally,...
  2. Replies
    20
    Views
    1,050

    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...
  3. Replies
    20
    Views
    1,050

    Re: Sparse Matrix Operations

    You have:



    for (int i = 0; i< a.nrElemente; i++)
    {
    Elems el;
    cout << el.Linie << " " << el.Coloana << " " << el.Valoare << endl;
    }
  4. Replies
    3
    Views
    488

    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...
  5. 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...
  6. 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 +=
  7. Replies
    10
    Views
    1,025

    Re: VS 2015 and standard headers

    Try:



    #include <cmath>
  8. Replies
    4
    Views
    581

    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 =...
  9. 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...
  10. 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...
  11. 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.
  12. 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];
    ...
  13. 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
    {
    arrayB_2D[j][counter++]...
  14. 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.
  15. 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...
  16. Replies
    3
    Views
    486

    Re: Why is there an exception?

    delete [] s;


    What is "s" pointing to ? many times you increment the value of s.
  17. 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 &...
  18. Re: Using std::istream with an already existing file

    It did not compile using g++ ver 4.8.1 under MinGW/Windows

    Here is a link for converting a file descriptor to a ostream or istream with g++.

    It compiled under g++ ver 4.8.1 under MinGW/Windows,...
  19. Replies
    12
    Views
    1,026

    Re: [RESOLVED] efficiency issues

    Just a note: that is implementation dependent. Almost all systems (except the one the OP is probably using) have RAND_MAX
    of at least 2^32.

    The rand() that Visual C++ uses does have a 32K...
  20. Replies
    15
    Views
    1,421

    Re: [RESOLVED] ofstream d'tor

    Yes ... it is supported under g++ ...

    I just tested using : g++ ver 4.5.1 under Linux and ver 4.8.1 under Windows/MinGW

    also see:
    ...
  21. Replies
    15
    Views
    1,421

    Re: [RESOLVED] ofstream d'tor

    1) what compiler are you using that uses :ios::bin instead of ios::binary ?

    2) On most non-microsoft systems, ios::binary does not do anything.
  22. Replies
    27
    Views
    3,681

    Re: Encrypt/Decrypt Problem

    You did not make the changes that I posted earlier. Make those changes and re-run.



    It is returning the entire string, but you are not printing it. You are using printf() to print the string....
  23. Replies
    27
    Views
    3,681

    Re: Encrypt/Decrypt Problem

    Here is the result that I get with the input that you said doesn't work:



    Input password: The Input pasword is meera@saraswathi@3c@
    The key is 123455
    The encrpted pasword is αkφ≈┬ !↕Ω║...
  24. Replies
    27
    Views
    3,681

    Re: Encrypt/Decrypt Problem

    At the very least:

    1) pass the length of the string to be decrypted to DecryptString:



    BOOL CCryptString::DecryptString(TCHAR* szEncryptPwd,TCHAR* szPassword,TCHAR *szKey , DWORD length_in)
  25. Replies
    27
    Views
    3,681

    Re: Encrypt/Decrypt Problem

    What type of debugging have you tried ?

    After the call:


    oCrypt.EncryptString(szPassword,szEncryptPwd,szKey);

    szEncryptPwd[16] = 0 (NULL)

    The function: DecryptString() has code that...
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

This a Codeguru.com survey!


HTML5 Development Center