|
bluatigro wrote: i have no idea where / what i have to change Well you cannot expect anyone here to understand all that code in a few minutes. You need to narrow down where the problem is and gather some more information about what is happening.
Your Window style should be based on WS_OVERLAPPEDWINDOW , not WS_POPUP . Google for "set Window full screen".
|
|
|
|
|
If you wrote the code to display the cube, then surely you can also remove it. If not, can you ask on the site where you procured the code from? Grabbing code from other sites, blindly throwing it into a compiler, and then wondering why it doesn't work hardly defines the software development process.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
i use the mdsn site + goolge for info
yes its a lot of code i wrote it myself
and i don't expect the error's to be fount fast
the problem whit my code is that you see the drawing of the triangles
over eatch other
i think i have to change somthing in WM_PAINT
but i m not sure
|
|
|
|
|
Hi I know the CDialog constructer takes two parameters an id template and Parent Cwnd
if my derived CDialog wanted to pass a parameter woud be the first or last
in my case I passed it as the first and got a warning
RTMDialog::RTMDialog(LPARAM mylparam, CWnd* pParent )
: CDialog(IDD_DIALOG9, pParent)
the extra param is mylparam
|
|
|
|
|
What kind of warning?
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
progDebug.cpp(356): warning C4930: 'RTMDialog Abenddialog(LPARAM,CWnd *)': prototyped function not called (was a variable definition intended?)
Here is the source
RTMDialog Abenddialog(LPARAM mylparam, CWnd* pParent );
|
|
|
|
|
class RTMDialog : public CDialog
{
DECLARE_DYNAMIC(RTMDialog)
public:
RTMDialog(LPARAM mylparam,CWnd* pParent = NULL);
|
|
|
|
|
So where's the problem?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
I had typo with the parameters thanks
|
|
|
|
|
This is a bit of a shot in the dark from me but I think you ran into the Most vexing parse - Wikipedia[^]
This line:
RTMDialog Abenddialog(LPARAM mylparam, CWnd* pParent ); ..has the signature of a function declaration but the name and arguments of your class constructor.
I'm a bit confused about where it could be "located" as you've shown your class declaration with a proper constructor declaration and the proper (beginning) of the constructor implementation. Maybe it's just needless?
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
If this is truly "source" as in the .cpp file then I think the problem is the semicolon.
|
|
|
|
|
That is a function declaration which takes two parameters and returns an RTMDialog object. Firstly, is that what you wanted, and secondly, what is this to do with your original question? Where exactly in your code is this declaration?
|
|
|
|
|
C4930 can also occur when the compiler cannot distinguish between a function prototype declaration and a function call. It looks like that is the case here and you wanted to create a dialog. Then it must be something like
RTMDialog Abenddialog(some_lparam, this);
|
|
|
|
|
it works fine until the 3 column but in the 4th column it doesn't.
#include <conio.h>
#include <stdio.h>
long int factorial(int num);
int main(){
int row, col_1, col_2, i, j;
long int k;
printf("Enter the number of rows: \n");
scanf("%d", &row);
col_1 = row-2;
for(i=0; i<=row-1; i++){
for(j=0; j<=col_1; j++){
printf(" ");
}
col_1--;
for(col_2=0; col_2<=i; col_2++){
k = factorial(i)/( factorial(i-col_2) * factorial(col_2) ) ;
printf(" %ld ", k);
}
printf("\n");
}
return 0;
}
long int factorial(int num){
int total, i;
if(num==0 || num==1){
total=1;
}else{
total = 1;
for(i=1; i<=num; i++){
total = total*num;
num--;
}
}
return total;
}
modified 28-Oct-17 15:42pm.
|
|
|
|
|
And did you try to debug your code?
|
|
|
|
|
for(j=0; j<=col_1; j++){
If col_1 has the value 4 in the above, you will actually perform 5 loops. Is that what you expect to happen?
|
|
|
|
|
Your factorial function is flawed (a decrementing num as stop condition for i is really a bad choice), try replacing it with
long int factorial(int num)
{
long int fact = 1;
int i;
for (i=2; i<=num; ++i)
fact *= i;
return fact;
}
|
|
|
|
|
thank you
|
|
|
|
|
|
i have an assigntment thats says that we have an infinite amount of elements and we need to check how many of those elements have a specific value
and i need to write algo in O(logn)
how is that possibble, i mean you must go through all the elements..
|
|
|
|
|
I started to answer this and then realized what you were saying
Yes you can't do O(log n) on an infinite not sorted sample you can't divid the listing.
I assume they mean O(n) time which is the only way it makes sense, or the samples have to
be sorted which you didn't state. You can search a dictionary or a phone book in O(log n)
because they are organized in order.
I should actually be more careful you can't do it on a single program.
You could setup more and more task/threads/processors to run your one program.
You see that with very big processor cluster farms etc.
In vino veritas
modified 28-Oct-17 12:57pm.
|
|
|
|
|
Having an infinite amount of stuff like that doesn't really make sense. Unlimited perhaps, in the sense that there is no a-priori constant limit that you can abuse to make all algorithms collapse to constant time. But infinite, no way. Even if it's sorted, it could start with infinite zeroes, which you therefore cannot count, nor could any higher element ever be reached. It just doesn't work.
|
|
|
|
|
Pi goes to inifinite decimal places .. creating the infinite output is easy and such things exist. Any irrational number is an example, the element involved being a digit.
Even in your case a computer will get thru thousands or millions of compares for a single digit per second.
If I asked you to count the digit 7 occurance in the PI output you can easily do it, and you could carry the count until you ran out of memory, disk space etc to hold the count. You only need the count you don't have to store the thing.
Doing it in O (log n) that is the question?
In vino veritas
modified 28-Oct-17 13:12pm.
|
|
|
|
|
Describing a procedure that produces infinite output is easy, yes. But you can never have all of its output, and no you cannot count the number of occurrences of the digit 7 in the decimal representation of PI. You can start to count, but you would never have the answer. That would technically not even be an algorithm, because an algorithm is an Effective Method, which means it must terminate in a finite number of steps.
|
|
|
|
|
I can't and wont agree, you can terminate any infinite processes on a different criteria
Pi to the 100,000 place is a classic example as is counting.
So even infinite processes can terminate in a finite number of steps you just don't
get a full precision solution.
Rounding, image analysis, smoothing, infinite searches and a pile of other fields all
have solution infinite algorithms that if left run would never end. However you concluded
them when you have sufficient accuracy for your needs and they are most definitely
normally called algorithms. I even know several of them are patented as Algorithms even
though under your definition they aren't because they would never end, except for they
pick an point to terminate the processing.
As a bit of humor I am not sure the field of Fractals knows it can't have algorithms
because every calc in the field goes to infinity you have to force bailout
Given there are multiple definitions of Algorithm I will leave it up to the OP to work
out with his teacher what definition of Algorithm they want to use. I am quite happy to
call what they are doing an algorithm even if you are not and it will just become a pointless
argument.
In vino veritas
modified 29-Oct-17 5:41am.
|
|
|
|