Forum: C++ May 29th, 2008 |
| Replies: 9 Views: 2,665 If there is truly a legitimate reason for a subclass to want to access a field, it should be declared "protected". |
Forum: C++ May 29th, 2008 |
| Replies: 7 Views: 1,829 These are identical. It is a pointer in both cases. So I guess it may be more clear to write it as a pointer. The second case might cause beginners to think that you are passing an entire array by... |
Forum: C++ May 11th, 2008 |
| Replies: 7 Views: 948 Also, a fundamental problem with your grow() function:
The last line is completely useless, because "array" is a local variable, assigning it has no effect outside the function. |
Forum: C++ May 2nd, 2008 |
| Replies: 7 Views: 595 wow.
what did you expect that code to do? |
Forum: C++ May 2nd, 2008 |
| Replies: 4 Views: 571 except that it doesn't check bounds |
Forum: C++ May 1st, 2008 |
| Replies: 5 Views: 705 just download it from the sourceforge project
http://sourceforge.net/projects/dev-cpp/ |
Forum: C++ Apr 29th, 2008 |
| Replies: 2 Views: 414 you need to make the method in the base class virtual
http://en.wikipedia.org/wiki/Virtual_function |
Forum: C++ Apr 24th, 2008 |
| Replies: 14 Views: 4,337 note that with any two numbers a and b, a * b = gcd(a, b) * lcm(a, b) |
Forum: C++ Apr 12th, 2008 |
| Replies: 3 Views: 575 maybe you are using a C compiler instead of C++ |
Forum: C++ Apr 10th, 2008 |
| Replies: 7 Views: 1,680 I think this will be possible in the next version of C++ |
Forum: C++ Apr 9th, 2008 |
| Replies: 3 Views: 508 result is set to 10 in the last iteration of the first for loop
and then you assign result (10) to every element of your 2-d array in the other for loops |
Forum: C++ Apr 3rd, 2008 |
| Replies: 3 Views: 3,430 there are numeric_limits<float>::quiet_NaN() and numeric_limits<float>::signaling_NaN() |
Forum: C++ Mar 30th, 2008 |
| Replies: 2 Views: 771 http://en.wikipedia.org/wiki/%3F: |
Forum: C++ Mar 18th, 2008 |
| Replies: 2 Views: 2,211 string is in the std namespace |
Forum: C++ Mar 17th, 2008 |
| Replies: 5 Views: 1,569 if you just used pointers
#ifndef LINE_H
#define LINE_H
class Point;
class Line
{
// Ax+By+C = 0 |
Forum: C++ Jan 6th, 2008 |
| Replies: 7 Views: 885 oh my god, you are allocating one character, and then you are setting that character to the character that has the ASCII value that is the length of some other string
look at it |