Search:
Type: Posts; User: Philip Nicoletti
Search:
Search took 1.18 seconds.
-
July 28th, 2022, 06:02 PM
This does not use cache, but one way is to use local static variables
in the function. They are initialized once and remembered between
function calls.
double GetValue(int index)
{...
-
July 20th, 2022, 12:20 PM
look at the case when i = len - 1 and j=i
Then j = len - 1
you are accessing arr[j+1] = arr[len-1+1] = arr[len]
which is outside the bounds of the array.
-
March 9th, 2022, 06:46 PM
1) When I created a toolbar on a dialog, I needed to call LoadToolBar() after Create()
2)
CToolBar a; is a local variable, so it will go out of scope when the function exits. Maybe it needs to...
-
September 2nd, 2020, 07:49 PM
Is your width a multiple of 4? Some systems require that you pad the BMP scan lines to make them a multiple of 4.
-
June 15th, 2020, 05:57 PM
It looks like you are using a C style printf format to look at the value.
Probably "%d" .. which is for integers ... use "%e"
-
June 23rd, 2019, 08:39 PM
You have name declared as an integer (and reading as an integer).
I suspect you are not entering an integer value for name.
-
June 16th, 2019, 06:44 PM
Simple example:
class MyClass
{
public:
const int & operator[](int i) const { return x[i]; }
int & operator[](int i) { return x[i]; }
-
April 16th, 2019, 06:49 AM
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...
-
April 15th, 2019, 08:13 AM
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); //...
-
August 26th, 2016, 06:35 PM
You can use GetWindowTextLength() to get the length of the window text (or a larger value).
See the documention.
-
July 28th, 2016, 10:03 AM
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...
-
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,...
-
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...
-
You have:
for (int i = 0; i< a.nrElemente; i++)
{
Elems el;
cout << el.Linie << " " << el.Coloana << " " << el.Valoare << endl;
}
-
March 4th, 2016, 07:29 AM
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...
-
February 25th, 2016, 10:27 AM
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...
-
February 25th, 2016, 06:12 AM
Since the variable, two, has a length of zero, I think that you should use operator +=
-
December 14th, 2015, 12:41 PM
-
December 10th, 2015, 08:36 AM
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 =...
-
December 4th, 2015, 01:45 PM
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...
-
December 4th, 2015, 12:18 PM
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...
-
October 19th, 2015, 06:23 AM
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.
-
October 9th, 2015, 10:40 AM
It should probably be:
for(int i=0; i<width*bytesPerPixel; i+=bytesPerPixel) // width
{
arrayB_2D[j][counter] = array_1D[offsetx + i+0];
...
-
October 9th, 2015, 10:25 AM
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++]...
-
October 9th, 2015, 09:58 AM
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.
|
Click Here to Expand Forum to Full Width
|