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

## Search: Search took 0.17 seconds.

by Philip Nicoletti
Replies
10
Views
628

### Re: VS 2015 and standard headers

Try:

#include <cmath>
2. ## Thread: Variable for a member variable

by Philip Nicoletti
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. ## Thread: Given an array that contains numbers from 1 to 1+n

by Philip Nicoletti
Replies
4
Views
370

### 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. ## Thread: Given an array that contains numbers from 1 to 1+n

by Philip Nicoletti
Replies
4
Views
370

### 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. ## Thread: Discrete Fourier Transform Test Results

by Philip Nicoletti
Replies
2
Views
355

### 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. ## Thread: Extracting RGB values from Bitmap Image

by Philip Nicoletti
Replies
9
Views
652

### 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. ## Thread: Extracting RGB values from Bitmap Image

by Philip Nicoletti
Replies
9
Views
652

### 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. ## Thread: Extracting RGB values from Bitmap Image

by Philip Nicoletti
Replies
9
Views
652

### 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. ## Thread: Extracting RGB values from Bitmap Image

by Philip Nicoletti
Replies
9
Views
652

### 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. ## Thread: Why is there an exception?

by Philip Nicoletti
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. ## Thread: How to design unordered_map's hash function for this case and another one?

by Philip Nicoletti
Replies
22
Views
1,562

### 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 &...

by Philip Nicoletti
Replies
5
Views
575

### 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. ## Thread: [RESOLVED] efficiency issues

by Philip Nicoletti
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. ## Thread: [RESOLVED] ofstream d'tor

by Philip Nicoletti
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. ## Thread: [RESOLVED] ofstream d'tor

by Philip Nicoletti
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. ## Thread: [RESOLVED] Encrypt/Decrypt Problem

by Philip Nicoletti
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. ## Thread: [RESOLVED] Encrypt/Decrypt Problem

by Philip Nicoletti
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. ## Thread: [RESOLVED] Encrypt/Decrypt Problem

by Philip Nicoletti
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. ## Thread: [RESOLVED] Encrypt/Decrypt Problem

by Philip Nicoletti
Replies
27
Views
2,805

### Re: Encrypt/Decrypt Problem

What type of debugging have you tried ?

After the call:

szEncryptPwd[16] = 0 (NULL)

The function: DecryptString() has code that...
20. ## Thread: Problem to read value from a file in visual studio 2015 C++

by Philip Nicoletti
Replies
4
Views
490

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

by Philip Nicoletti
Replies
4
Views
490

### 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. ## Thread: C++ Class member function Bug Can't see it

by Philip Nicoletti
Replies
16
Views
987

### 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. ## Thread: Stringstream error: out of range in memory

by Philip Nicoletti
Replies
3
Views
509

### 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. ## Thread: Little/Big Endian test code in machine and file

by Philip Nicoletti
Replies
22
Views
1,541

### 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. ## Thread: c++ stl map

by Philip Nicoletti
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