Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements
Ranked #3K
~11.6K People Reached
PC Specs
Intel P4 2.4GHz, 512mb Ram, ATI Radeon 128mb
Favorite Forums
Favorite Tags

39 Posted Topics

Member Avatar for djbsabkcb

Numerous recursive calls of a function produce delays. The maths is done in the previous answer to your question by Rashakil Fol. Besides this sequence produces really big numbers. I changed the algorithm a bit and even the 50th member of the sequence goes over the boundaries of the long …

Member Avatar for josh2k12
0
2K
Member Avatar for freemind

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 here. There is some number of minor flaws of logical type and I would …

Member Avatar for Rashakil Fol
0
272
Member Avatar for badchick
Member Avatar for freemind

Hi to all! I'm writing a simple simulation program for elevators but i get a problem, namely: [CODE] elevator.cpp: In constructor `Elevator::Elevator(int)': elevator.cpp:41: error: no matching function for call to `Button::Button()' elevator.cpp:10: note: candidates are: Button::Button(const Button&) elevator.cpp:16: note: Button::Button(int, bool) elevator.cpp:41: error: no matching function for call to `Button::Button()' …

Member Avatar for freemind
0
393
Member Avatar for mugilan

[left][CODE] [left]#include<iostream> #include<string> using namespace std; class employee { string first; string last; int salary; public: void getdata(void); void setdata(void); employee() { salary = 0; last=""; first=""; } }; void employee::getdata(void) { cout<<"\na first name: " << first; cout<<"\na last name: " << last; cout<<"\nmonthly salary: " << salary; } …

Member Avatar for nattylife
0
1K
Member Avatar for DeVilSoul

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.

Member Avatar for nattylife
0
264
Member Avatar for Mahen

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.

Member Avatar for Stoned_coder
0
254
Member Avatar for paladin4service

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: [url="http://www.intap.net/~drw/cpp/cpp03_04.htm"]http://www.intap.net/~drw/cpp/cpp03_04.htm[/url]

Member Avatar for Ancient Dragon
0
248
Member Avatar for 3265002918

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 and over again until the user gives a correct input or use labels. I recommend you …

Member Avatar for 3265002918
0
345
Member Avatar for iamthwee

The simplest way is to use a loop. A for(unsigned long i=user_input; i > 1; i--); could be one solution.

Member Avatar for bops
0
387
Member Avatar for zauber

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, though, by using headers, that include various functions for string manipulation (string.h for example.) The …

Member Avatar for zauber
0
116
Member Avatar for sleevetrick

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 create console graphics. There is a topic on this and more detailed explonation in the code …

Member Avatar for sleevetrick
0
302
Member Avatar for Mahen

Maybe something like: extern char mir[200]; in test.h can solve your problem ?

Member Avatar for freemind
0
170
Member Avatar for cyber_aziz

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 you pasted there.. it's quite long for …

Member Avatar for freemind
0
218
Member Avatar for evilsilver

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 imagination ;)

Member Avatar for Drowzee
0
414
Member Avatar for Zababa

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 it - this you have to check.

Member Avatar for Zababa
0
384
Member Avatar for wu7jian

[QUOTE] more quesion , namespace is only related to header file?[/QUOTE] No. std is to iostream.h (cstdio.h respectively) but namespaces are just logical units holding whatever belongs in a logical way together. Ex.: [CODE] namespace simple_operations { double sum(double a, double b) { return a+b; }; double mul(double a, double …

Member Avatar for Lerner
0
194
Member Avatar for deadoh
Member Avatar for rks01

[CODE] #include <iostream> #include <string> using namespace std; class Account { public: Account(): balance(0.0) {}; inline bool checkpass(string number, string password) { // some way to check number and pass return 1; } inline float GetBalance() { return balance; }; // and so on ... private: float balance; }; int …

Member Avatar for rks01
0
194
Member Avatar for thiru.y

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..;)

Member Avatar for freemind
0
112
Member Avatar for indianscorpion2

Since everybody is against the idea I'll play for it. Yes, that is Dave! (I'm searching for supporters!:cheesy: )

Member Avatar for freemind
0
127
Member Avatar for cyber_aziz

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 memories :-) ). Anyway since you're using a low-level language for something, that it's not meant …

Member Avatar for freemind
0
169
Member Avatar for angel22

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 could be putting the unsorted lines in a temp file, taking the …

Member Avatar for angel22
0
548
Member Avatar for Gillzor

What is the connection between running a game and Visual C++ ? It's a bit late here but I can't find an obvious link between the two. The error that you get usualy appears when you cause an undefined (from language point of view) situation in a program. There are …

Member Avatar for Gillzor
0
341
Member Avatar for Gink

The Art of Assembly is a book that I find quite nice, understandable and deep enough.

Member Avatar for freemind
0
107
Member Avatar for POW

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 don't think somebody will write the code for you, but I'm sure somebody will …

Member Avatar for Dave Sinkula
0
76
Member Avatar for ORA-MAN

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 this: [url="http://members.lycos.co.uk/keithmbriggs/doubledouble.html"]http://members.lycos.co.uk/keithmbriggs/doubledouble.html[/url]

Member Avatar for Stoned_coder
0
239
Member Avatar for zeek

Zeek, in the real world people don't use such numbers. For convenience in different sciences units are defined to mean something when the basic unit is on power (-3), (-6), (-9) and so on (as well as their positive corresponding values). Since you have put time and effort in this …

Member Avatar for vegaseat
0
283
Member Avatar for trsja56

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. [url="http://www.cpp-home.com/tutorial.php?26_1"]http://www.cpp-home.com/tutorial.php?26_1[/url] is your link. On the other hand - why are you trying to send …

Member Avatar for trsja56
0
158
Member Avatar for freemind

Here I paste a simple address book/telephone book. The linker spits the following error: g++.exe derived2.o -o "Derived2.exe" -L"C:/Dev-Cpp/lib" derived2.o(.text$_ZN2ABD2Ev[AB::~AB()]+0x3a):derived2.cpp: undefined reference to `vtable for AB' derived2.o(.text$_ZN2ABC2ESsSsSs[AB::AB(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >)]+0x3d):derived2.cpp: undefined reference to `vtable for AB' collect2: ld returned 1 exit status …

Member Avatar for freemind
0
246
Member Avatar for freemind

Hi to everybody! Here I paste some simple exercise code that I wrote. The errors are pasted from the compiler log at the end of the source code. The add() function looks ok to me and I can't understand what the compiler wants from me :o Thanks! [CODE] #include <iostream> …

Member Avatar for TomcatMCAD
0
434
Member Avatar for mixsir

Try to simplify your algorithms. Remember that you can combine loop types. This is often useful ;) . Also don't forget the code tags when you post code, because with them it's much more readable. One possible solution I paste below. Enjoy. [CODE]#include <iostream> using namespace std; int main(void) { …

Member Avatar for zyruz
0
113
Member Avatar for lallous

[CODE]#include <iostream> #include <string> using namespace std; class weather { private: int day; int month; int year; int temp; int humid; string condition; void leapyear(int); public: weather(int a=1,int b=99,int c=54,int d=100,int e=33,string= "Elie"); //Problem //~weather(); void setall(int,int,int,int,int); int get_day(); int get_month(); int get_year(); int get_temp(int); int get_humid(); void print(); void …

Member Avatar for lallous
0
107
Member Avatar for freemind

Hi! I paste a short sample for a subfunction of a class of mine. I get an error about the declaration of "of" and I'm not quite sure what's wrong :rolleyes: To this I would like to ask if anybody knows how can I check in a new file for …

Member Avatar for zyruz
0
127
Member Avatar for jhdobbins

This looks like C to C++. Classes and structures are quite close so maybe you should consider using a class.. Pointers to structures use -> to address structure elements. Since you'll have many similar structures you actually have to consider a dataNode array(in case we stick to structures). Goto is …

Member Avatar for jhdobbins
0
245
Member Avatar for freemind

Hi to everybody! I'm writing a program that has to simulate a working system for deliveries of goods to some cities. I get several mistakes from the compiler while temporarly checking the code but they can't point me out the problem good enough.. Therefore I dare to bother you with …

Member Avatar for freemind
0
94
Member Avatar for gluber

More or less on every operating system you have to cope with folder's attributes to enforce some way of protection to it's contents. One way is being the root of the system and provide the necessary changes to directory's attributes and making it unaccessible for any other user or simply …

Member Avatar for Narue
0
197
Member Avatar for freemind

Hello everybody! I'm quite new to C++ and as exercise I had to write a simple program, trying to duplicate the strcpy(), strlen() and strcmp() functions in C++. The code seems to be ok from syntax point of view but the results are quite unsatisfying :o. If anyone could point …

Member Avatar for freemind
0
103
Member Avatar for akshayabc

[code]#include <stdio.h> #define BUFSZ 255 struct lala { char name[BUFSZ]; unsigned age; // for example :-) } student[10]; int main(void) { for(int i=0; i < 10; i++) scanf("%s %d", &student[i].name, &student[i].age); // Using scanf() for reading strings is in general not a good idea. // Look at fgets(). It is …

Member Avatar for akshayabc
0
139

The End.