Forum: C++ Sep 10th, 2004 |
| Replies: 8 Views: 3,016 Hi,
The problem is that we need to clear the input buffer before using gets() because gets() read anything in the input buffer until it encounters a new line or return character. Although it works... |
Forum: Computer Science Aug 24th, 2004 |
| Replies: 4 Views: 3,825 Math part of computer science hard?
It depends on your potential and the applications you are working on. If you write programs involved with graphics, then it might require some calculus and... |
Forum: C++ Aug 24th, 2004 |
| Replies: 19 Views: 8,497 It cannot compare between C++ and Calculus because they are different subject. Learning C++ takes years to understand and to master the subject. One might think that learning C++ is boring. In my... |
Forum: C Aug 17th, 2004 |
| Replies: 34 Views: 7,992 i++: do the calculation or do the comparison before the i's value is increment.
++i: increment the i's current value by 1 before doing the calculation or doing the comparison.
Hence, using in for... |
Forum: C Jun 15th, 2004 |
| Replies: 7 Views: 6,484 Sorry! I take back my words. In the above case it is wrong since the above array is not allocated in the heap(unless using new operator), so you are 100% correct. (I messed up with Java since array... |
Forum: C Jun 15th, 2004 |
| Replies: 7 Views: 6,484 Yes. Absolutely, you are right about local data goes out of scope, but the value is always correct since the pointer is going out of scope, but the memory, which pointer pointed to is still there... |
Forum: C Jun 15th, 2004 |
| Replies: 7 Views: 6,484 To Kalachylde: It does not perform what we are expected to because of two reasons: it will return integer instead of array of integer, and return graph[6][6] means creating one new array of integer... |
Forum: C Jun 7th, 2004 |
| Replies: 7 Views: 6,484 Hi all,
What should I write for function signature in order to return this 6X6 array without compiler error? I tried to use int* getGraph(), but it did not work.
Thanks for your help.
... |
Forum: C May 13th, 2004 |
| Replies: 8 Views: 44,511 Hi Dave,
What is the %n used for in sscanf(ptr, "%3d%n", &value, &i)? Thanks. |
Forum: C++ May 11th, 2004 |
| Replies: 16 Views: 168,150 Hi Dave,
The error is caused because of square bracket[] (I just wrote code in Java, so I used wrong () ). After changing to [], the program runs correctly.
Thanks for everything, Dave.
... |
Forum: C++ May 11th, 2004 |
| Replies: 16 Views: 168,150 Thanks Dave. However, would you mind if I have another question regarding to the same problem? While I was waiting for your solution, I developed one in below.
I know your code is much superior than... |
Forum: C++ May 11th, 2004 |
| Replies: 16 Views: 168,150 Hi Dave,
I appreciate for your help, but it does not work correctly in the following case. We declare static local variable, so this variable will stay until the program is terminated. Hence,... |
Forum: C++ May 11th, 2004 |
| Replies: 16 Views: 168,150 Hi all,
We can see that the result is not what we are expected. Can anyone tell me what need to fix in order to get the correct result using same function? Thanks in advance.
#include... |
Forum: C++ May 11th, 2004 |
| Replies: 16 Views: 168,150 I am sorry. I did not make my point clear. Is there any way to return the array from the function, this array is created within that function? For instance, I want to have one function to return an... |
Forum: C++ May 11th, 2004 |
| Replies: 16 Views: 168,150 Hi all,
Could anyone help me about returning the array from a function? I believe that it is a syntax error (compile time error) to return an array from a function, but one book mentions briefly... |