Forum: C++ Mar 26th, 2009 |
| Replies: 14 Views: 1,028 Looks OK. The switch in the else needs + 1 from case 3 to case 12 Every month from march on needs one day more because of leapyear. Alternatively you could also use one switch and let your... |
Forum: C++ Mar 25th, 2009 |
| Replies: 14 Views: 1,028 Well you have made a function how do you know it works. TEST it.
Make a small program.
Input : year.
Feed year to your leapyear function does it work as expected? Is 1800 a leap year is -200 a... |
Forum: C++ Mar 25th, 2009 |
| Replies: 14 Views: 1,028 What about testing that function in a smal program as pointed out earlier?
For the rest that's up to you, I should start thinking of making a list like so:
jan 0
feb 31
mar 59
apr 90
etc. ... |
Forum: C++ Mar 25th, 2009 |
| Replies: 14 Views: 1,028 Hey! I did not notice until now, look after the and operator : !== is not an operator, use != |
Forum: C++ Mar 25th, 2009 |
| Replies: 14 Views: 1,028 First don't use an assignment operator in an if statement
year%4 = 0 better use == here.
Second you don't have to declare an extra variable isLeap. Just use return true or return false.
Perhaps... |
Forum: C++ Mar 25th, 2009 |
| Replies: 14 Views: 1,028 Start with the leap year function:
This function must return true or false, it's input is a year value.
Test if the year value is divisible by 100, if so then test if it's divisible by 400, if it... |
Forum: C++ Feb 18th, 2009 |
| Replies: 7 Views: 1,033 It's _fseeki64 I think and it's in <stdio.h> |
Forum: C++ Feb 18th, 2009 |
| Replies: 7 Views: 1,033 fseek32( filepointer , positie , SEEK_SET )
What is the value of positie or is it a typo? |
Forum: C++ Feb 2nd, 2009 |
| Replies: 2 Views: 361 The first term of your sum is always zero, so start with i=2.
Use an if-statement for the first factor of your product. If i is even then it is -1 else it is 1. For the second factor I should use... |
Forum: C++ Jan 31st, 2009 |
| Replies: 5 Views: 431 meal = (t / (tar + 100)) * 100; ???
Why not use meal = t * (tar +100)/100; ? |
Forum: C++ Jan 25th, 2009 |
| Replies: 3 Views: 321 str[i] * multiplier += total;
You are multiplying on the left side of the assignment operator +=.
Note that an assignment operator is not the same thing as an equal sign in math.
This is allowed... |
Forum: C++ Jan 24th, 2009 |
| Replies: 6 Views: 415 #2 will print out more than a million a+space i guess...
clutchkiller:
When you have a file with a million 'a' characters in it and you want to see it (most of the time on a screen) then there is a... |
Forum: C++ Jan 23rd, 2009 |
| Replies: 11 Views: 809 First :
Make all your vars of type float.
The time I have to pay a meal that exceeds the range of a float I stop eating let alone that I have to pay in a range that would exceed a double type!... |
Forum: C++ Jan 11th, 2009 |
| Replies: 8 Views: 372 I thought the question was how the modulo operator works, but it's about odd and even... |
Forum: C++ Jan 11th, 2009 |
| Replies: 8 Views: 372 How it is actually done I dunno.
But if I would write a routine that does it I would continuously subtract 2 from b until zero or until b<2 and return that value. |
Forum: C++ Jan 5th, 2009 |
| Replies: 11 Views: 1,056 Use Vector and do all this in one stroke.
Vector containers are implemented as dynamic arrays.
Also : if line 14 is true you set geneBool to true, perfect!
Set genBool to false in the first place... |
Forum: C++ Jan 5th, 2009 |
| Replies: 11 Views: 1,056 If I understand your explanation well, do the following:
Read a line of your file.
Is line in array?
no: put it there. Increment a counter.
yes or else : read next line.
until EOF |
Forum: C++ Jan 3rd, 2009 |
| Replies: 3 Views: 945 An array is in fact a constant pointer pointing to a block of memory.
So
char message [] = { 'H', 'e', 'l', 'l', 'o', '\0' };
char message [] = "Hello";
is valid : initialisation
message = {... |
Forum: C++ Jan 3rd, 2009 |
| Replies: 15 Views: 655 It seems weird to me that a method called AddSettings would create a global variable you declared earlier. |
Forum: C++ Jan 1st, 2009 |
| Replies: 6 Views: 627 Locate MSVCR80.DLL on your hard drive and put it in c:\windows\system32.
A thing I found in the first hit I get when searching for "allegro MSVCR80"
It was on :... |
Forum: C++ Dec 30th, 2008 |
| Replies: 6 Views: 627 Well in VC++ right click the References in the Solution Explorer to Add Reference then browse for the MSVCR80.dll |
Forum: C++ Dec 29th, 2008 |
| Replies: 6 Views: 627 If you know which dll your problem is half solved. |
Forum: C++ Dec 29th, 2008 |
| Replies: 3 Views: 1,124 Whenyou add a dll you must at least have some information about what is in it. You must also use a using or include clause. |
Forum: C++ Dec 28th, 2008 |
| Replies: 13 Views: 1,159 strange... what if my name is U2 ? |
Forum: C++ Dec 28th, 2008 |
| Replies: 13 Views: 1,159 You can read in a string like this :
string Mystr;
cout << "What's your name? ";
getline (cin, Mystr); |
Forum: C++ Dec 28th, 2008 |
| Replies: 13 Views: 1,159 First declare an array and put your cin in a loop to read in every digit of your bignumber. Check if it's a digit and put it in the array. |
Forum: C++ Dec 28th, 2008 |
| Replies: 13 Views: 1,159 Have you any code?
What are the problems you have with it? |
Forum: C++ Dec 27th, 2008 |
| Replies: 8 Views: 736 Nice.
But why let the value be generic and the name not? Or was that the intention in the first place in which case I have said nothing. |
Forum: C++ Dec 26th, 2008 |
| Replies: 7 Views: 578 Please, please code tags!
http://www.daniweb.com/forums/announcement8-3.html |
Forum: C++ Dec 26th, 2008 |
| Replies: 3 Views: 383 It certainly doesn't harm to know this stuff. |
Forum: C++ Dec 25th, 2008 |
| Replies: 14 Views: 772 GUI existed as of almost 30 years ago.
Consoles were invented before that time to replace a teletypewritermachine (tty) which was a machine producing a papertape with the output(text) of the... |
Forum: C++ Dec 25th, 2008 |
| Replies: 5 Views: 470 What have you written so far?
I assume it should be in C++ since it is posted here.
What kind of problems do you have with your code? |
Forum: C++ Dec 25th, 2008 |
| Replies: 7 Views: 403 Leave #include<stdafx.h> out.
Btw:
Computers are not god.
Computers should not be feared.
Use another learn C++ book. |
Forum: C++ Dec 16th, 2008 |
| Replies: 8 Views: 1,176 Have you added these files to your solution? |
Forum: C++ Dec 16th, 2008 |
| Replies: 8 Views: 1,176 I think this is what you need http://www.codeproject.com/KB/buttons/roundbuttons.aspx |
Forum: C++ Dec 15th, 2008 |
| Replies: 4 Views: 488 Thanks for the clarification.
I saw the forrest but forgot about the trees... |
Forum: C++ Dec 15th, 2008 |
| Replies: 4 Views: 488 When you mark a method of your class as virtual you give the user of your class the possibility to override that method. If you don't, the metod can't be overridden. |
Forum: C++ Dec 14th, 2008 |
| Replies: 42 Views: 1,996 You have a string variable declared as sortList and a method declared as sortList.
Decide what you want, there are systems who can detect this before you even compile things. |
Forum: C++ Dec 14th, 2008 |
| Replies: 42 Views: 1,996 case 1:
Num_Students = i;
for (int ii =0; ii < Num_Students; i++)
scores[ii] = grades[ii].ID
... |
Forum: C++ Dec 14th, 2008 |
| Replies: 3 Views: 1,196 You must more think in objects. What do they have? what do they do? A driver seat is not really needed when driving a car ! (But it is handy if you have one) Think in a more abstract way of driving a... |