Forum: C++ Jun 15th, 2006 |
| Replies: 13 Views: 2,190 Lesson learned but unfortunately the fact persists for our very case. Since I have the 2 options now - either to rewrite everything or to try to correct it as it is I'm a bit more for the second... |
Forum: C++ Jun 15th, 2006 |
| Replies: 13 Views: 2,190 I will read on this topic, thanks.
If you are so kind to share these things with me I could use the time to correct the outlook of the program. |
Forum: C++ Jun 15th, 2006 |
| Replies: 13 Views: 2,190 Generally you're right about the testing. I can't think of a way, though, to check every function, especially when one function often uses the other from the same class and executable code is... |
Forum: C++ Jun 15th, 2006 |
| Replies: 13 Views: 2,190 liblifts.h is the dirty worker in this case so this is the place. I presume that the Elevator class is the primary and probably almost only source of errors. The open_doors() function and the move()... |
Forum: C++ Jun 15th, 2006 |
| Replies: 13 Views: 2,190 I found a plase to paste it: http://rafb.net/paste/results/Jqrme337.html |
Forum: C++ Jun 15th, 2006 |
| Replies: 13 Views: 2,190 They will make no sense without the other code. Besides the program is divided into files, besides the function and namespace division.. |
Forum: C++ Jun 15th, 2006 |
| Replies: 13 Views: 2,190 Hi everybody! I recently wrote a little simulation program, that simulates a real-time elevator system with 3 elevators. Since the code is around 530 lines I presume it is not a good idea to paste it... |
Forum: C++ May 17th, 2006 |
| Replies: 5 Views: 2,565 Perhaps the second :-) Thanks! |
Forum: C++ May 17th, 2006 |
| Replies: 5 Views: 2,565 Default constructor i don't need in this case, because i need to set up some predifined values for buttons and states. I'm still a bit confused how to edit my code so it's working, though. As for the... |
Forum: C++ May 17th, 2006 |
| Replies: 5 Views: 2,565 Hi to all! I'm writing a simple simulation program for elevators but i get a problem, namely:
elevator.cpp: In constructor `Elevator::Elevator(int)':
elevator.cpp:41: error: no matching... |
Forum: C++ Aug 16th, 2005 |
| Replies: 8 Views: 1,463 Don't forget that C++ gives you the opportunity to use string instead of char[]. Combining this with the usage of find() and substr() can solve your problems. |
Forum: C++ Aug 16th, 2005 |
| Replies: 8 Views: 2,574 The documentation of your compiler keeps the answers to many "secrets". Besides ALPHA and BETA releases of programs carry these names for the sole reason to say that they are still unfinished. |
Forum: C++ Aug 16th, 2005 |
| Replies: 13 Views: 2,022 temp *= num--; is equivallent to: temp = temp*(num-1);
temp += 5; is equivallent to: temp = temp + 5;
The shorthand operators are basic and useful, due to their simplicity and length. |
Forum: C++ Aug 15th, 2005 |
| Replies: 13 Views: 2,022 The simplest way is to use a loop. A for(unsigned long i=user_input; i > 1; i--); could be one solution. |
Forum: C++ Aug 13th, 2005 |
| Replies: 10 Views: 2,328 Then consider using another compiler.;) If you want to start over when something in the user's choice goes wrong you can either provide an ethernal loop around the code that should be performed over... |
Forum: C++ Aug 13th, 2005 |
| Replies: 54 Views: 13,004 #include<iostream>
#include<string>
using namespace std;
class employee
{
string first;
string last;
int salary; |
Forum: C Aug 9th, 2005 |
| Replies: 5 Views: 3,896 Maybe something like: extern char mir[200]; in test.h can solve your problem ? |
Forum: C++ Aug 9th, 2005 |
| Replies: 5 Views: 2,079 Since strings in C are arrays of characters and an array is something quite trivial to programming languages, you don't need to import libraries to get strings to work. You can make your life easier,... |
Forum: C++ Aug 8th, 2005 |
| Replies: 6 Views: 3,796 I'm reading your post and I can't really get what the problem is, especially with the decimal.. The reminder you can find using the % operator. More information and details you can find here:... |
Forum: C++ Aug 8th, 2005 |
| Replies: 6 Views: 1,950 Although it's not for VC++ you can look through the code of cyber_azis and find some answers. There is a Borland library adapted for Dev-Cpp (another C++ compiler) that gives you the opportunity to... |
Forum: C Aug 8th, 2005 |
| Replies: 1 Views: 1,409 Simple. Always get stuff from the user as a string. Then check it and get from it what you need. If you don't find it - shoot an error and let a new input be given. There are some lines of code that... |
Forum: C Aug 4th, 2005 |
| Replies: 6 Views: 1,156 No. std is to iostream.h (cstdio.h respectively) but namespaces are just logical units holding whatever belongs in a logical way together.
Ex.:
namespace simple_operations {
double... |
Forum: C++ Aug 4th, 2005 |
| Replies: 4 Views: 1,212 |
Forum: C++ Aug 4th, 2005 |
| Replies: 4 Views: 1,212 include conio.h and use getch(); |
Forum: C Aug 3rd, 2005 |
| Replies: 1 Views: 1,422 If you're so kind to post some errors that you get, as well as a brief information about the platform that you're trying to install/use it on, maybe someone can answer you..;) |
Forum: C++ Aug 3rd, 2005 |
| Replies: 4 Views: 1,230 Since everybody is against the idea I'll play for it. Yes, that is Dave! (I'm searching for supporters!:cheesy: ) |
Forum: C++ Aug 3rd, 2005 |
| Replies: 4 Views: 1,713 Look here, maybe this will help you a bit also: http://www.devarticles.com/c/a/Cplusplus/Using-MFC-in-Cplus-Part-2-Menus/7/ |
Forum: C++ Aug 3rd, 2005 |
| Replies: 7 Views: 1,733 You can write a program to create all these things. Just a random generator for the quantities. The names you can find in adventure books for children, comics, old movies/games or.. in your... |
Forum: C++ Aug 3rd, 2005 |
| Replies: 4 Views: 1,713 What you're writing looks a bit more like pure C then C++. You're obviously using headers imported from Pascal to C and C++ respectively (the names of the functions you're using are calling some... |
Forum: C++ Aug 2nd, 2005 |
| Replies: 17 Views: 3,700 The sorting you can do in many ways. One way could be putting all the data in let's say a class and then sort the vector of objects with ssort(), qsort() or whatever function you want. Other way... |
Forum: Pascal and Delphi Aug 2nd, 2005 |
| Replies: 3 Views: 4,674 The last time when I used Pascal was ages ago, but I do remember a function delay(), i.e. delay(6); gives u a delay from 6 seconds. Maybe you need to use Crt (or if there is a new name for it) to get... |
Forum: Assembly Aug 2nd, 2005 |
| Replies: 1 Views: 4,434 The Art of Assembly is a book that I find quite nice, understandable and deep enough. |
Forum: C++ Aug 2nd, 2005 |
| Replies: 15 Views: 5,064 Gillzor, the problems with the games are in general 2 - insufficient hardware recources (you're on the limit, but I don't think this is your problem) and outdated drivers for video/monitor/directx... |
Forum: C++ Aug 2nd, 2005 |
| Replies: 5 Views: 2,838 #include <iostream>
#include <string>
using namespace std;
class Account {
public:
Account(): balance(0.0) {};
inline bool checkpass(string number, string password) {
//... |
Forum: C++ Aug 2nd, 2005 |
| Replies: 2 Views: 1,260 Since both programs require relatively low knowledge over the language you can try to find a few tutorials and go over them. This doesn't require too much time and it'll get you over the basics. I... |
Forum: C++ Aug 2nd, 2005 |
| Replies: 3 Views: 1,728 double in C++ has a 64-bit precision. long double has the same I think, which leaves you with the opportunity to use either double, or if it's not good enough for you, you can use something like... |
Forum: C++ Aug 1st, 2005 |
| Replies: 11 Views: 6,829 Rashakil Fol, you know what I mean. |
Forum: C Aug 1st, 2005 |
| Replies: 6 Views: 1,869 I'm giving you the "I wash my hands" type of answer, namely a link to a tutorial but I hope it would prove to be useful, since it looks like covering all the important stuff.... |
Forum: C++ Aug 1st, 2005 |
| Replies: 15 Views: 5,064 It is quite obvious what you wish. Maybe if you try to answer some of the questions you were asked somebody will be able to help you. |