Sythe.Org Forums     Register     FAQ     Members List     Calendar     Mark Forums Read    
 
Sythe.Org Forums  
   Runescape Gold

Sythe.org — A Virtual Goods Trading Hub

Make real cash! buying and selling in-game items.

We have a no-scam policy.

You can make thousands playing your favourite games here at Sythe.org.

Just sign up an account and follow the rules!


Take me to

Runescape Markets

Other Game Markets

Support Center

Register an Account

Close
C++ help
Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 05-24-2012, 11:11 PM
Grand Master
 
Join Date: Nov 2008
Location: SFA
Posts: 2,780
Default C++ help

Hey, i'm using the Dev C++ compiler, and typically when I compile my code it runs movely, no erros, but when I run the programs, some of them don't do anything after the "cout's". I'll run the program, it prompts me the cout that I have, but it does nothing after that.

Here's the code.

Code:
#include <iostream.h>
#include <math.h>
#include <stdlib.h>

int main()
{
	double h;
	double t = 0.0;
	double v = 0.0;
	double s = 0.0;
	cout << "Whats is the height of the object?" << endl;
	cin >> h;
	cout << h;
	while(h > 0);
	{
		t++;
		h--;
		v = t * 32.0;
		s = t * t * 16.0;
		cout << "The volocity is " << v << ", The height of the object is " << h << 
		", and " << t << "seconds have gone by";
	}
}
Just a simple program.

Thanks.
Reply With Quote
  #2  
Old 05-29-2012, 04:39 AM
ilovegold69's Avatar
Forum Addict
 
Join Date: Aug 2011
Posts: 540
Send a message via MSN to ilovegold69 Send a message via Skype™ to ilovegold69
Default Re: C++ help

you're missing an endl; after your cout statement

Code:
cout << "The volocity is " << v << ", The height of the object is " << h << ", and " << t << "seconds have gone by" endl;
__________________

Last edited by ilovegold69 : 05-29-2012 at 04:45 AM.
Reply With Quote
  #3  
Old 05-29-2012, 11:18 PM
T7 Press 7T's Avatar
Forum Addict
 
Join Date: Jun 2007
Posts: 384
Send a message via MSN to T7 Press 7T
Default Re: C++ help

Could be because you forgot:
Code:
using namespace std;
After your header files.
__________________



Last edited by T7 Press 7T : 05-29-2012 at 11:19 PM.
Reply With Quote
Reply



Cheap RS Gold Store  Runescape Gold

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

All times are GMT +1. The time now is 09:10 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.6.1