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.17 seconds.

  1. Replies
    10
    Views
    628

    Re: VS 2015 and standard headers

    Try:



    #include <cmath>
  2. Replies
    4
    Views
    428

    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 =...
  3. 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...
  4. 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...
  5. 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.
  6. 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];
    ...
  7. 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++]...
  8. 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.
  9. 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...
  10. Replies
    3
    Views
    394

    Re: Why is there an exception?

    delete [] s;


    What is "s" pointing to ? many times you increment the value of s.
  11. 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 &...
  12. 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,...
  13. Replies
    12
    Views
    851

    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...
  14. Replies
    15
    Views
    1,105

    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:
    ...
  15. Replies
    15
    Views
    1,105

    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.
  16. Replies
    27
    Views
    2,805

    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....
  17. Replies
    27
    Views
    2,805

    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φ≈┬ !↕Ω║...
  18. Replies
    27
    Views
    2,805

    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)
  19. Replies
    27
    Views
    2,805

    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...
  20. Re: Problem to read value from a file in visual studio 2015 C++

    I'm not exactly sure what you want. maybe an example would help. column oriented input is a bit tricky. In many cases it would be easier to read the entire line into a string and parse the string. ...
  21. Re: Problem to read value from a file in visual studio 2015 C++

    maybe something like this:



    while (getline(totot,name,':')) // read everything up to an including the first ':' into name
    {
    double x;
    totot >> x;
    ...
  22. Re: C++ Class member function Bug Can't see it

    1) what is the purpose of the "mn = buf;" line

    2) Does the code that calls this function expect buf to be NULL terminated ?
    I don't see any guarantee that buf is NULL terminated

    3) This looks...
  23. Re: Stringstream error: out of range in memory

    Do you have blank lines in the files ? If so, you will get an out-of-range error on the "at(0)" calls.

    I would change:



    while(ss)
    {
    ss >> holder;
    if (holder.at(0) == 'X')
  24. Re: Little/Big Endian test code in machine and file

    CFD codes write out in binary, since writing "text"s would be considerably slower and increase the size of data written. They usually take care of it one of two ways:

    1) similar to "netcdf...
  25. Replies
    8
    Views
    758

    Re: c++ stl map

    You have:



    //.cpp
    std::map<u8, u8> m_mlistOfCliConfiguredPolicyRules = boost::assign::map_list_of(Apn_Fred, 9);


    I am guessing it should be:
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 is a Codeguru.com survey!


HTML5 Development Center