Forum: C++ May 16th, 2006 |
| Replies: 24 Views: 5,350 Well, atleast I think I have learned some very good lessons from this thread.
Next time I post at daniweb C and C++ forum I promise I will be at a different level than I am currently now - which... |
Forum: C++ May 16th, 2006 |
| Replies: 24 Views: 5,350 Yeah! But you did not give any explanation that time and it worked well on all the other compilers. All my common sense told me it's something to do with gcc - the compiler itself. Besides the... |
Forum: C++ May 16th, 2006 |
| Replies: 24 Views: 5,350 This is what happens when I use your code. The effect is same as mine. This time it's in GIF format. Hope that's okay with you. |
Forum: C++ May 16th, 2006 |
| Replies: 24 Views: 5,350 If you run the loop for say 50 times that's enough most of the time to get the desired result. So instead of using x1 != x0, I would use the following code
for(i = 0; i < 50; ++i)
x = .5 * (x... |
Forum: C++ May 15th, 2006 |
| Replies: 24 Views: 5,350 First you explain to me how come uncommenting a printf() statement makes the loop end. This simply doesn't make any sense.
Within a few iterations the new value of x1 differs so small from the... |
Forum: C++ May 15th, 2006 |
| Replies: 24 Views: 5,350 %lf is valid for scanf(), so it is natural for anyone to think it is also valid for printf(). Things like this is easy to miss unless someone explicitly mentions it.
Now I want to know how much... |
Forum: C++ May 15th, 2006 |
| Replies: 24 Views: 5,350 Thanks everyone for being so patient with me, especially Salem who actually downloaded MinGW gcc. I really appreciate that!
Here's the screen capture of what I am getting. First I compile the... |
Forum: C++ May 14th, 2006 |
| Replies: 24 Views: 5,350 I never claimed to have found a bug in gcc. I merely suggested that it could be a possibility. If you look at my first post I was here to clarify if it was due to a bug with the gcc or due to... |
Forum: C++ May 13th, 2006 |
| Replies: 24 Views: 5,350 I read the first article back in my "Computer organisation and design" class regarding how to represent real numbers inside computers. And I have already told you I am completely aware that the... |
Forum: C++ May 13th, 2006 |
| Replies: 24 Views: 5,350 There is no hole in my code. I said I am aware of the comparison issue with double/float datatypes. I said so because some of you might jump into the conclusion that checking for inequality between... |
Forum: C++ May 13th, 2006 |
| Replies: 24 Views: 5,350 The following code finds the square root of a number, it runs fine unless you compile with MinGW gcc:
#include<stdio.h>
#include<stdlib.h>
int main(void)
{
double x0,x1,a;
int i;
x1 =... |
Forum: C++ Apr 22nd, 2006 |
| Replies: 3 Views: 6,170 I need to do certain things when user tries to close the window. Say may be to ask him whether he actually wants to quit or not etc. That's why I cant let DefWindowProc() to handle it. But that was... |
Forum: C++ Apr 21st, 2006 |
| Replies: 3 Views: 6,170 I am kind of confused about how DestroyWindow() works. According to the help files this function sends a WM_DESTROY message to the window it has just removed from the screen. In my WindowProc I have... |
Forum: C++ Apr 5th, 2006 |
| Replies: 1 Views: 7,678 I am trying to access files in a folder. The folder name and location will be given - the program will search inside the files in that folder for a specific pattern(yup like grep). However, I am not... |
Forum: C++ Mar 15th, 2006 |
| Replies: 8 Views: 4,159 True.
In the long term it is not, except for the students who don't know much about programming except for making good GUIs in Java. |
Forum: C++ Mar 15th, 2006 |
| Replies: 8 Views: 4,159 My database is not for commercial use. I needed an SDK which was free for 'non-commercial' purpose. I preferred to use 'educational' in this context.
Ha ha. The funny thing is that it will be... |
Forum: C++ Mar 14th, 2006 |
| Replies: 8 Views: 4,159 I guess I found this:
GrFinger Biometric SDK (http://www.griaule.com/page/en-us/downloads) |
Forum: C++ Mar 14th, 2006 |
| Replies: 8 Views: 4,159 I was looking for an SDK to learn a bit about fingerprint identification system. I have googled a lot and found many different SDKs. However none of them were free. I dont want to implement any... |
Forum: C++ Jan 11th, 2006 |
| Replies: 4 Views: 3,339 graphics.h wont work with Visual C++. You have to learn win32 APIs. |
Forum: C++ Jan 8th, 2006 |
| Replies: 7 Views: 1,752 Whoa! you guys are fast, one minute ago there were no reply and now two posts in between the red's first and mine.
To red:
I can use getch() or getche() in gcc that comes with MinGW, so you... |
Forum: C++ Jan 8th, 2006 |
| Replies: 7 Views: 1,752 Yes, but you can't do them portably. If you are using borland or visual C++ compilers you can try the getch() or getche() function to do that. |
Forum: C++ Nov 27th, 2005 |
| Replies: 15 Views: 3,315 Then why dont we hear something along this line about cin and scanf() as we hear about gets():
reason: the professor used gets().
Why not say the same when the professor uses scanf() or cin>>.... |
Forum: C++ Nov 27th, 2005 |
| Replies: 15 Views: 3,315 The links given above says that there is no way to pass the number of characters gets() should read, so a mischievous user can intentionally overflow the buffer to cause havoc. And "THAT'S WHY" you... |
Forum: C++ Nov 26th, 2005 |
| Replies: 15 Views: 3,315 Is it because the user can overflow the buffer by entering more characters than the array or the pointer can hold? If that is the reason then scanf(), cin>> they are also not safe. So why blame... |
Forum: C++ Nov 26th, 2005 |
| Replies: 2 Views: 1,150 Try solving acm problems
acm.uva.es/problemset/ |
Forum: C++ Nov 26th, 2005 |
| Replies: 8 Views: 2,013 using lstdcxx, libstd and libcxxgives the following error
-----------------------------------
ld.exe: cannot find -libcxx
collect2: ld returned 1 exit status
... |
Forum: C++ Nov 25th, 2005 |
| Replies: 8 Views: 2,013 I'd be willing to bet that the errors you're getting are linker errors.
Yes, they are linker errors like undefined reference to XYZ. So how do I link C++ programs using gcc with ease? |
Forum: C++ Nov 25th, 2005 |
| Replies: 8 Views: 2,013 I've recently swithed from borland C++ 5.5 to MinGW. When I try to compile a .c file using gcc it compiles fine, but when I try to compile a .cpp file using gcc it produces a bunch of errors with c++... |
Forum: C++ Nov 22nd, 2005 |
| Replies: 4 Views: 2,149 Sorry, this actually has nothing to do with this program. It's just cin fails to read ans because a char has been given instead of an int. |
Forum: C++ Nov 21st, 2005 |
| Replies: 4 Views: 2,149 that's because your ans is of type int. Try this instead:
char ans.
In C char literals like 'y' and 'Y' are actually of type int, but in C++ they are of type char.
And try to declare your array... |
Forum: C++ Nov 18th, 2005 |
| Replies: 2 Views: 1,994 I havent used a debugger, but I think it produces runtime error depending on the input. For some input the online judge uses it produces the error, not for the input i gave to it. |
Forum: C++ Nov 18th, 2005 |
| Replies: 2 Views: 1,994 This is (supposed to be) a soln for a ACM problem (http://acm.uva.es/p/v1/101.html)
But the program produces a runtime error.
Can anyone spot the bug?
#include<iostream>
#include<string>
... |
Forum: C++ Nov 8th, 2005 |
| Replies: 11 Views: 3,843 Hmmm, I think you are right. I used faralloc only in Turbo C. I guess in 32-bit addressing systems there wont be any data which is "far", it should always be "near", hence there's no need for a... |
Forum: C++ Nov 7th, 2005 |
| Replies: 11 Views: 3,843 Arrays and even calloc and malloc allocate contiguous memory. And the amount of contguous memory you can allocate at one time may be limited. If you need to work with large dataset then try linked... |
Forum: C++ Nov 7th, 2005 |
| Replies: 13 Views: 5,194 I sort of stumbled upon this:
http://www.geocities.com/SiliconValley/Vista/7184/guitool.html
It says Qt is the best.
Could anyone tell me what is the relation between Qt and MinGW? |
Forum: C++ Nov 6th, 2005 |
| Replies: 13 Views: 5,194 I wanted to explore and know about the GUI toolkits available to be used with C or C++.
I heard a bit about Qt, GTK, Mingw etc, and there's MFC too.
For the moment I am not quite sure which one to... |
Forum: C++ Oct 29th, 2005 |
| Replies: 3 Views: 10,327 Big task.
Luckily, some people have already done some work.
http://www.swox.com/gmp/
If you want to implement on your own, then goodluck. I myself only implemented integers with trivial addition,... |
Forum: C++ Oct 28th, 2005 |
| Replies: 6 Views: 6,495 So it's a nice copy from the web :)
Nevermind, just ignore what I said. |
Forum: C++ Oct 28th, 2005 |
| Replies: 6 Views: 6,495 Nice copy from the web ;) |
Forum: C++ Oct 15th, 2005 |
| Replies: 7 Views: 4,313 I ran the code. It gives error only when you try to delete the file when it is not closed. As ancient dragon mentioned you need to close the file like fin.close() before trying to remove it. I ran... |