190 Posted Topics

Member Avatar for rodeostar04

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.

Member Avatar for rodeostar04
-1
100
Member Avatar for jrrr

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 …

Member Avatar for stilllearning
0
85
Member Avatar for sunveer

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!...

Member Avatar for stilllearning
0
87
Member Avatar for swbuko
Member Avatar for eehyf
Member Avatar for eehyf
0
191
Member Avatar for Majestics

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 …

Member Avatar for stilllearning
0
2K
Member Avatar for kux

It's a long shot, but maybe while optimizing compiler got rid of unneeded functions and code in library?

Member Avatar for ArkM
0
106
Member Avatar for grisha83

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

Member Avatar for Sci@phy
0
101
Member Avatar for Sci@phy

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 …

Member Avatar for kux
0
91
Member Avatar for Sci@phy

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

Member Avatar for Duoas
0
396