#include <stdio.h>
#include <time.h>
#include <iostream> // std::cout, std::cin
#include <ostream> // <<, std::endl;
#include <istream> // >>
int main()
{
double a; // Primul numar introdus
double b; // Al doilea numar introdus
std::cout
<< "Acest program afiseaza suma a doua numere introduse de la tastatura, iar la sfarsit un mic bonus." << std::endl;
std::cin.exceptions( std::ios_base::iostate( -1 ) );
//daca scriu o litera sau orice altceva in afara de cifre, da eroare
std::cout << "Introduceti numarul A: ";
std::cin >> a;
std::cout << "Introduceti numarul B: ";
std::cin >> b;
std::cout << "Suma este: " << a + b << "." << std::endl;
return 0;
}
void wait ( int seconds )
{
clock_t endwait;
endwait = clock () + seconds * CLOCKS_PER_SEC ;
while (clock() < endwait) {}
}
int main()
{ <- Here's the error...
int n;
printf ("Incepe numaratoarea...\n");
for (n=5; n>0; n--)
{
printf ("%d\n",n);
wait (1);
}
printf ("Bonus time!\n\n");
printf (" *\n");
printf (" * * ******** \n");
printf (" ***** * * \n");
printf (" * * ** *** \n");
printf (" * * * ** ** * \n");
printf (" ***** *** ***** *** \n");
printf (" __ ________ ________ \n");
printf (" T__ --|| | | | | \n");
printf (" |_______|-|________|-|________| \n");
printf (" OOOO OO OO OO OO OO \n");
return 0;
}
C++ help
Moderator: Core Staff
C++ help
Hello! I need some help with this please. I made a program in C++ which has to calculate the sum of 2 numbers. It worked fine. After that, I wanted to make a countdown and at it's end I wanted to make a house, a car and a train appear. And I get 1 error... Here's the program, if you have C++ please test it and help me fix that error!
"I don't care either way. I'm tired of you assholes thinking I'm gay just because I like squirrels and guys with sunglasses." - Soviet
Re: C++ help
hmm i couldnt fix it
try running it in debug, choose the line where the error occurs and try to remove/fix that text... sry for giving useless help =(


-
- Core Staff
- Posts: 13315
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Re: C++ help
You have 2 functions named the same thing? Main and Main?

Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010
Re: C++ help
What he said, that is the major problem I see in your code.Drofder2004 wrote:You have 2 functions named the same thing? Main and Main?
Also, you forgot the ".h" at the end of your last three includes.
Coding is Poetry. Mapping is Art.
"Cause im the sexiest mapper ever...except for nm, that sexy man" - Soviet
-=[CoDJumper.com Movies]=-
[Ambush] || [Backlot] || [Bloc] || [Bog] || [Broadcast] || [Chinatown] || [Countdown]
[Crash] || [Creek] || [Crossfire] || [District] || [Downpour] || [Killhouse] || [Overgrown]
[Pipeline] || [Shipment & Wetwork] || [Showdown] || [Strike] || [Vacant]
"Cause im the sexiest mapper ever...except for nm, that sexy man" - Soviet
-=[CoDJumper.com Movies]=-
[Ambush] || [Backlot] || [Bloc] || [Bog] || [Broadcast] || [Chinatown] || [Countdown]
[Crash] || [Creek] || [Crossfire] || [District] || [Downpour] || [Killhouse] || [Overgrown]
[Pipeline] || [Shipment & Wetwork] || [Showdown] || [Strike] || [Vacant]
-
- Core Staff
- Posts: 2214
- Joined: February 6th, 2006, 3:18 pm
- Location: Germany/Bayern
Re: C++ help
u dont need the .h
double function name conflict -.- <- copy and paste error etc
double function name conflict -.- <- copy and paste error etc
THAT HANDS WERE NOT TRACED!
visit my blog: Link
visit my blog: Link
Soviet wrote:Yeah, watch out, Peds will hit you with his +5 D-Battleaxe of homosexuality
Re: C++ help
Depends which compiler you use. To be safe though, it is always good to put .hLev!athan wrote:u dont need the .h
double function name conflict -.- <- copy and paste error etc
Coding is Poetry. Mapping is Art.
"Cause im the sexiest mapper ever...except for nm, that sexy man" - Soviet
-=[CoDJumper.com Movies]=-
[Ambush] || [Backlot] || [Bloc] || [Bog] || [Broadcast] || [Chinatown] || [Countdown]
[Crash] || [Creek] || [Crossfire] || [District] || [Downpour] || [Killhouse] || [Overgrown]
[Pipeline] || [Shipment & Wetwork] || [Showdown] || [Strike] || [Vacant]
"Cause im the sexiest mapper ever...except for nm, that sexy man" - Soviet
-=[CoDJumper.com Movies]=-
[Ambush] || [Backlot] || [Bloc] || [Bog] || [Broadcast] || [Chinatown] || [Countdown]
[Crash] || [Creek] || [Crossfire] || [District] || [Downpour] || [Killhouse] || [Overgrown]
[Pipeline] || [Shipment & Wetwork] || [Showdown] || [Strike] || [Vacant]
-
- Core Staff
- Posts: 2214
- Joined: February 6th, 2006, 3:18 pm
- Location: Germany/Bayern
Re: C++ help
i guess he doesn't use cygwin - rather more visual studio -.-
THAT HANDS WERE NOT TRACED!
visit my blog: Link
visit my blog: Link
Soviet wrote:Yeah, watch out, Peds will hit you with his +5 D-Battleaxe of homosexuality
Who is online
Users browsing this forum: No registered users and 1 guest