Skip to main content
gamedev.net
🔒 Locked

need help

Started by oceangirl2012 0 replies 700+ views
Original Post
oceangirl2012
oceangirl2012
Hi all i am just wondering wats wrong with this program. When i compile it it says there is something wrong with my (float distance;) if any one has any ideas or suggestions they would be greatly appreciated. Cheers // #include <cstdio> #include <cstdlib> #include <iostream> using namespace std; int main(int nNumberofArgs, char* pszArgs[]) { cout << "This program is designed to convert Polar Co-ordinates into Cartesian Co-Ordinates. Created by Trent Rhodes" float distance; cout << "plese enter the distance of the polar co-ordinate:"; cin >> distance; float angle; cout << "please enter the angle of the polar co-ordinate:"; cin >> angle; float X; X = distance*(cos*angle) float Y; Y = distance * sin * angle cout << "X value is:" cout << X << endl; cout << "Y value is:"; cout << Y << endl; system("pause"); return 0; }
DekuTree64
DekuTree64
Hmm, I don't see anything wrong with your distance variable, but sin and cos are functions, so you need to call them like sin(angle), instead of sin*angle

EDIT: Oops, there's a missing semicolon on the line before your float distance;, that's what's giving you the error :)

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.