Click here to Skip to main content
15,888,521 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
C++
#include
#include
#include

using namespace std;

void Nuskaito (int A[],int &n) {
ifstream fd("muge.txt");
fd>>n;
for (int i=0; i>A[i];
fd.close;
}
int Suma(int A[],int n){
int s=0;
for (int i=0; i50)K++;
return K;
}
int main(){

int n;
int A[50];
Nuskaito(A,n);
for (int i=0;i


What I have tried:

What I have tried:

What should I fix?
Error:
line 12: statement cannot resolve adress of overloaded function
Warning:
line 31: this 'for' clause does not guard ...{-Wmisleading-indentation}
Note:
line 33 this statement,but the latter is misleadingly indented as if it is guarded
Posted
Updated 18-Apr-20 14:59pm
v2
Comments
Richard MacCutchan 19-Apr-20 3:40am    
You need to go back to your course notes. Your for statements are incomplete, you are trying to use uninitialised variables as targets of expressions, using the wrong syntax for method calls, using variable references that you have not declared ...

1 solution

You posted pretty much the same code yesterday, and the same error list: and you still haven't fixed it?

Come on - look at what you have written and look at the error messages, they are mostly pretty clear.
Line 12: is a "}" so it's probably the line above:
fd.close;
And the error is talking about functions, so ... shouldn't close have brackets:
fd.close();

The other two I can't even see any lines for, so I can't comment, but it's probably pretty obvious if you read the error and the code then think about the actual syntax of the language.

While we are happy to help people, fixing compilation errors is a fundamental part of coding: if you can't do it yourself, then you are going to get very much overwhelmed very quickly - and that means that if you want to be able to write an app any anything approaching one line of working code a day then you are going to have to start fixing them yourself as it truly is much, much quicker than waiting for others to do it for you.

And if you post code in future, for your own good, use the "code" widget above the entry text box; it preserves your formatting and translated html characters like < and > so they don't mess up what you paste in...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900