C Error Cannot Be Used As A Function
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the error expression cannot be used as a function c++ workings and policies of this site About Us Learn more about
Cannot Be Used As A Function Mathematica
Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions cannot be used as a function arduino Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other.
Time Cannot Be Used As A Function
Join them; it only takes a minute: Sign up Error: expression cannot be used as a function? up vote -5 down vote favorite I created a quick method in my program to compute the distance between two points using the distance formula, here's the code: #include
right below the namespace, but i think the problem relates to the use of the variable
Variable Cannot Be Used As A Function
rather than a declaration 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include
Max Cannot Be Used As A Function
std; double pwr(double co2); int main( ) { double loan_hand, int_rate, face_value, monthly_payment, time_period, int_month, co1, co2, arduino function mp1, loan_amount; cout<< "Please enter amount in hand?\n"; cin >> loan_hand; cout<< "Please enter the interest rate?\n"; cin >> int_rate; cout << "Please enter the time period http://stackoverflow.com/questions/21617609/error-expression-cannot-be-used-as-a-function in months.\n"; cin >> time_period; int_month=int_rate/12; monthly_payment=loan_hand/time_period; co1=monthly_payment/int_month; co2= pow(1-(1+int_month, time_period(-1)); loan_amount=co1*co2; cout << "you will need a loan with a face value" << loan_amount; system("PAUSE"); return EXIT_SUCCESS; } Using a dev C++ compiler, the variable time_period appears to be considered a function and I'm not sure why. I know this is simple and appreciate any http://www.cplusplus.com/forum/beginner/72524/ clear or concise answer, or a track to find as such. Thank You Jun 4, 2012 at 4:45pm UTC Stewbond (2805) time_period is declared as a double. Therefore time_period(-1) is incorrect. Try either co2= pow(1-1+int_month, time_period-1); or co2= pow(1-1+int_month, time_period); or co2= pow(1-1+int_month, -1); depending on what you are trying to do. Last edited on Jun 4, 2012 at 4:49pm UTC Jun 4, 2012 at 4:46pm UTC Zhuge (4636) You are putting parentheses after it like its a function, so the compiler is complaining that it isn't. If you want multiplication, use the * symbol. Jun 4, 2012 at 4:48pm UTC Disch (13766) Also you have mismatched parenthesis. Jun 4, 2012 at 4:50pm UTC Lowest0ne (1536) You're only passing one argument to pow(), it needs two: double x = pow(2.0, 3); // x = 8 Last edited on Jun 4, 2012 at 4:50pm UTC Topic archived. No new replies allowed. C++ Information Tutorials Reference Articles Forum Forum BeginnersWindows ProgrammingUNIX/Linux ProgrammingGeneral C++ ProgrammingLoungeJobs
New Topic/Question Reply 2 Replies - 17596 Views - Last Post: 03 March 2009 - 07:25 PM Rate Topic: #1 thwhisler New D.I.C Head Reputation: 1 Posts: 11 Joined: 20-February 09 error: cannot be used a function Posted 03 March 2009 - http://www.dreamincode.net/forums/topic/90425-error-cannot-be-used-a-function/ 06:54 PM I am writing a program that will calculate the determinates of 2 by 2 https://www.reddit.com/r/arduino/comments/2mr50w/error_x_cannot_be_used_as_a_function/ or 3 by 3 matrixes. This is what i currently have: #include
»arduinocommentsWant to join? Log in or sign up in seconds.|Englishlimit my search to /r/arduinouse the following search parameters to narrow your results:subreddit:subredditfind submissions in "subreddit"author:usernamefind submissions by "username"site:example.comfind submissions from "example.com"url:textsearch for "text" in urlselftext:textsearch for "text" in self post contentsself:yes (or self:no)include (or exclude) self postsnsfw:yes (or nsfw:no)include (or exclude) results marked as NSFWe.g. subreddit:aww site:imgur.com dogsee the search faq for details.advanced search: by author, subreddit...this post was submitted on 19 Nov 20141 point (67% upvoted)shortlink: remember mereset passwordloginSubmit a new linkSubmit a new text postarduinosubscribeunsubscribe66,670 readers~50 users here nowA reddit for all things Arduino. Arduino Information: Language Reference Examples Homepage Arduino to Breadboard Arduino Forum Arduino IRC Arduino Twitter Feed Related Subreddits: Electrical and Computer Engineering Electronics Electrical Engineering Books Component Exchange Beginners: Beginner Kits Parts List Online/Text Resources Tutorials Where to buy: Sparkfun Adafruit SeeedStudio Tools / References: Online Circuit Simulator Component Search Eagle PCB Design a community for 8 yearsmessage the moderatorsMODERATORStrvrdiecimilacrazycreator13AVRptorroneabout moderation team »discussions in /r/arduino<>X123 points · 6 comments A larg