190 Posted Topics
Re: Well, first, "class" is a c++ keyword, you can't use that name. Second, that last else in your code should be: else if (weight >= 3500 && year >= 1980) or: else Because else means "if nothing before is true", it can't have an expression to evaluate. | |
Re: Sounds like you're in a hurry... First of all, DON'T USE <iostream.h> and <string.h>... Instead use <iostream> and <cstring>. Second, main can't be declared like that, it has to be: int main(){ //code here return 0; } Cheers! EDIT: and yes, you are using system(), that means you have to … | |
Re: And what is the problem? To help you a little, your sequence is the same as: (-1)^2 * x^1/1! + (-1)^3 * x^2/2!... | |
Re: If print is a function... you need brackets: (currnode->contact).print(); | |
Re: You can use ostringstream from <sstream>, i use that, although it may not be the easyest way. [CODE] #include <sstream> std::string Convert (float number){ std::ostringstream buff; buff<<number; return buff.str(); } [/CODE] ostringstream and istringstream are basically the same as cout and cin, but they don't print stuff on screen. So … | |
Re: It's a long shot, but maybe while optimizing compiler got rid of unneeded functions and code in library? | |
Re: The best thing is not to use string to hold only one letter (very bad idea). So instead of [CODE]string letter;[/CODE] you better write: [CODE]char letter;[/CODE] HTH | |
Hi all. I've written my own class Complex, that stores complex numbers. I've overloaded a whole bunch of operators so that you can work with them like with normal numbers. Then i wanted to overload 'new', but I tried it before overloading, and it "seems" to be working. I can … | |
Hello. Any way of preventing multiple instances of executables? I'm writing a program that uses a file, it would be quite messy if someone would start another instance of same program. If it depends on OS, I would like to see solutions for windows and unix-type (linux) systems. Thanx |