Error expected initializer before cin

Error expected initializer before cin I’m writing a class with an array and I’m supposed to calculate the average of some entered grades outside the class and in the main but I get the error Expected Initializer before ‘.’ token I’m not to sure what to do or i even did the class right […]

Содержание

  1. Error expected initializer before cin
  2. Error expected initializer before cin
  3. Error expected initializer before cin
  4. Error expected initializer before cin
  5. Error expected initializer before cin

Error expected initializer before cin

I’m writing a class with an array and I’m supposed to calculate the average of some entered grades outside the class and in the main but I get the error
Expected Initializer before ‘.’ token

I’m not to sure what to do or i even did the class right
Please help!

What if I promised you $1000, but then just walk away, leaving you empty handed?
You make a promise on line 24, but you don’t keep it.

The error is on line 44. Please explain this code:
float gradeAverage.getGrade();

Line 44 looks like a nice prototype, but what is it doing in the middle of the program?

In the function «getGrade()» Why are you printing the array when you should be returning something from the array. In this case the «getGrade()» function should have a parameter the represents the element of the array that you need.

As you have it «float getGrade ()» would be better named «void printGrades ()».

Hope that helps,

I know that i shouldn’t be printing the there but the question was my teacher gave me was this
Write a class called Student that contains a property called grades that can store a
maximum of 10 grades. Create a setter and a getter method. The setter method
will take no parameters and return no parameters. Instead, within the setter
method you must construct a loop that will ask the user to enter 10 grades. The
getter method will simply print the 10 grades; so, it will take no and return no
parameters. Yes, that is a misnomer; this is because passing and returning arrays
has not been covered yet. Create another method called computeAverage that
return the average of all the grades. Create another method called
minimumGrade that returns the minimum grade the student received.

He knows it’s a misnomer but he wants us to do it anyway.
He hasn’t covered it yet so I was just looking it up but nothing I find helps

Now that I see what is required I will take a look tomorrow and see what I can do.

Источник

Error expected initializer before cin

I keep receiving this error, nothing I do helps it’s in
line 11, while (again == ‘Y’ || again == ‘Y’) //begins while loop

You do have something essential missing, the braces around the body of the function.
See: http://www.cplusplus.com/doc/tutorial/program_structure/

Once you have followed that advice you will get a different error: What is the «again»?

PS. Please edit your post to use code tags.
See: http://www.cplusplus.com/articles/jEywvCM9/
Pay attention to indentation too. It can help reading your code.

When I put a brace < before the while statement I end up with a 10 more errors?
This is my first programming class I have never done anything like this and I’m frustrated.

These are the instruction for the program, I have to include all of this and I don’t even know if I have included all of it.

Create the following program which converts Fahrenheit to Celsius. Your program must have the following functions:
•Read integer Fahrenheit temperatures from the user. You need to check whether the input is the correct one or not. If the user enters the incorrect number, ask it again.
•Use the formula: Celsius = (Fahrenheit – 32) * 5.0 / 9.0
•The output Celsius should be a floating point with two digits of precision.
•The Celsius temperatures should be displayed with a sign of positive or negative.
•The program should ask the user to continue or not. If the user wants to do the conversion again, use repetitive statements such as DO WHILE, FOR, or IF THEN ELSE to do the conversion again.
•Add comments to explain the functions of the program.

I have been working on this and this is what I now have, with a set of new errors.
which are [Error] ‘setprecision’ cannot be used as a function
and [Error] ‘setw’ cannot be used as a function

Hi dreaweiss, welcome to the forum.

I’ll outline the problems with your code:

1.) On line 4, you declare three variables. Two of them, namely ‘setprecision’ and ‘setw’ are also the names of functions found in the ‘std’ namespace. Normally, one would access these functions by using the scope-resolution operator like so: std::setprecision and std::setw . However, since you’ve elected to use using namespace std; in global scope, the compiler thinks that your function calls on lines 28 and 30 are actually attempts to treat your variables on line 4 as functions.

The way to fix this is to simply remove the offending variables on line 4, since you aren’t even using them for anything. Your fourth line of code should therefore only declare ‘again’.

2.) Technically, line 4 shouldn’t just declare ‘again’, but also define / initialize it. If you do not give ‘again’ an initial value, you’re invoking undefined behavior on line 5 when you enter the while-loop because ‘again’ contains garbage, and you’re attempting to access it. Fix this by initializing ‘again’ on line 4 (so that it may enter the while-loop).

In addition, ‘again’ shouldn’t be an int , it should be a char .

3.) There’s a discrepancy in the condition of your while-loop on line 5. What you probably meant to write was while (again == ‘y’ || again == ‘Y’ ) , not while (again == ‘Y’ || again == ‘Y’ ) .

4.) The while-loop on line 5 has no body. The semi-colon (‘;’) immediately following the parentheses on line 5 is the cause of this. You will have to remove the semi-colon and add some braces (‘<‘ and ‘>‘) around all of the code that should be part of the while-loop’s body.

That should be a good start. I’ve appended this basic code as a guide:

Xismn,
Thank you
I followed all of your directions, I no longer have any errors in my code but when I run it the black boxes opens and nothing is in it. It should be asking for a Fahrenheit degree and then give it to me Celsius, and then ask if I want to convert more values. I don’t know where to go from here, with no errors showing up
This is what have now

Источник

Error expected initializer before cin

I keep receiving this error, nothing I do helps it’s in
line 11, while (again == ‘Y’ || again == ‘Y’) //begins while loop

You do have something essential missing, the braces around the body of the function.
See: http://www.cplusplus.com/doc/tutorial/program_structure/

Once you have followed that advice you will get a different error: What is the «again»?

PS. Please edit your post to use code tags.
See: http://www.cplusplus.com/articles/jEywvCM9/
Pay attention to indentation too. It can help reading your code.

When I put a brace < before the while statement I end up with a 10 more errors?
This is my first programming class I have never done anything like this and I’m frustrated.

These are the instruction for the program, I have to include all of this and I don’t even know if I have included all of it.

Create the following program which converts Fahrenheit to Celsius. Your program must have the following functions:
•Read integer Fahrenheit temperatures from the user. You need to check whether the input is the correct one or not. If the user enters the incorrect number, ask it again.
•Use the formula: Celsius = (Fahrenheit – 32) * 5.0 / 9.0
•The output Celsius should be a floating point with two digits of precision.
•The Celsius temperatures should be displayed with a sign of positive or negative.
•The program should ask the user to continue or not. If the user wants to do the conversion again, use repetitive statements such as DO WHILE, FOR, or IF THEN ELSE to do the conversion again.
•Add comments to explain the functions of the program.

I have been working on this and this is what I now have, with a set of new errors.
which are [Error] ‘setprecision’ cannot be used as a function
and [Error] ‘setw’ cannot be used as a function

Hi dreaweiss, welcome to the forum.

I’ll outline the problems with your code:

1.) On line 4, you declare three variables. Two of them, namely ‘setprecision’ and ‘setw’ are also the names of functions found in the ‘std’ namespace. Normally, one would access these functions by using the scope-resolution operator like so: std::setprecision and std::setw . However, since you’ve elected to use using namespace std; in global scope, the compiler thinks that your function calls on lines 28 and 30 are actually attempts to treat your variables on line 4 as functions.

The way to fix this is to simply remove the offending variables on line 4, since you aren’t even using them for anything. Your fourth line of code should therefore only declare ‘again’.

2.) Technically, line 4 shouldn’t just declare ‘again’, but also define / initialize it. If you do not give ‘again’ an initial value, you’re invoking undefined behavior on line 5 when you enter the while-loop because ‘again’ contains garbage, and you’re attempting to access it. Fix this by initializing ‘again’ on line 4 (so that it may enter the while-loop).

In addition, ‘again’ shouldn’t be an int , it should be a char .

3.) There’s a discrepancy in the condition of your while-loop on line 5. What you probably meant to write was while (again == ‘y’ || again == ‘Y’ ) , not while (again == ‘Y’ || again == ‘Y’ ) .

4.) The while-loop on line 5 has no body. The semi-colon (‘;’) immediately following the parentheses on line 5 is the cause of this. You will have to remove the semi-colon and add some braces (‘<‘ and ‘>‘) around all of the code that should be part of the while-loop’s body.

That should be a good start. I’ve appended this basic code as a guide:

Xismn,
Thank you
I followed all of your directions, I no longer have any errors in my code but when I run it the black boxes opens and nothing is in it. It should be asking for a Fahrenheit degree and then give it to me Celsius, and then ask if I want to convert more values. I don’t know where to go from here, with no errors showing up
This is what have now

Источник

Error expected initializer before cin

I Keep getting this error message, and i’m sure it has something to do with how I am attempting to call my functions. I have been at this for hours, what am I doing wrong?

error: expected initializer before ‘double’
double tsav(int tstotal,int tsgradecounter, int grade)

using namespace std;

double qzav(int qztotal,int qzgradecounter, int grade)
double tsav(int tstotal,int tsgradecounter, int grade)

double hwav(int hwtotal,int hwgradecounter, int grade)

int option; //option for menu

string firstname;
double qzaverage= qzav(qztotal,qzgradecounter,grade);
double tsaverage= tsav(tstotal,tsgradecounter,grade);
double hwaverage= hwav(hwtotal,hwgradecounter,grade);

cout > option; //print option

cout>> «Quiz»>> endl;
cin >»Test»>> endl;
cin >»Homework»>> endl;
cin > «Quiz averager»;
cout > grade;

qztotal= qztotal + grade; //total quiz grade

qzgradecounter= qzgradecounter + 1;

if (qzgradecounter !=0)

qzaverage= static_cast (qztotal)/ qzgradecounter;

tstotal= tstotal + grade;

tsgradecounter= tsgradecounter + 1;

if (tsgradecounter !=0)

tsaverage= static_cast (tstotal)/ tsgradecounter;

hwtotal= hwtotal + grade;

hwgradecounter= hwgradecounter + 1;

if (hwgradecounter !=0)

hwaverage= static_cast (hwtotal)/ hwgradecounter;

Источник

Error expected initializer before cin

prog3.cpp:10:1: error: expected initializer before ‘int’
int main ()
^
this is what i get when i run this program please any help regarding this it will be much appreciated and please tell me if i made this program workable like with boolean expression if the function and prototype are well declared and performing together

/*This program ask user to input Hour, Minute and seconds and if the user
put in the valid format it runs othervise it says error. */

bool readTime(int &hours, int &minutes, int &seconds)

int main ()
<
int h,m,s;
if(readTime(h,m,s)) <
printf(«%2d:%2d:%2d» h, m, s);
return 0;
>
>

printf(«please enter time in format 09:30:50n»);
int count = scanf(«%2d:%2d:%2d», &hh, &mm, &ss);
>
// did they get the right format?
if (count !=3) <
printf(«Invalid formatn»);
return false;
>
// is the number of hours correct?
if ((hh 23)) <
printf(«Invalid hour %d n», hh);
return false;
>
//is number of minutes wrong?
if ((mm 0)) <
printf(«Invalid Minutes %d n», mm);
return false;
>
//is number of seconds wrong?
if ((ss 0)) <
printf(«Invalid seconds %d n», mm);
return false;
>

now this is what i get after doing your instructions

prog3.cpp: In function ‘int main()’:
prog3.cpp:14:28: error: expected ‘)’ before ‘h’
printf(«%2d:%2d:%2d» h, m, s);
^
prog3.cpp:14:35: warning: format ‘%d’ expects a matching ‘int’ argument [-Wformat=]
printf(«%2d:%2d:%2d» h, m, s);
^
prog3.cpp: In function ‘bool readTime(int&, int&, int&)’:
prog3.cpp:24:8: warning: unused variable ‘count’ [-Wunused-variable]
int count = scanf(«%2d:%2d:%2d», &hh, &mm, &ss);
^
prog3.cpp:25:4: warning: no return statement in function returning non-void [-Wreturn-type]
>
^
prog3.cpp: At global scope:
prog3.cpp:27:4: error: expected unqualified-id before ‘if’
if (count !=3) <
^
prog3.cpp:32:4: error: expected unqualified-id before ‘if’
if ((hh 23)) <
^
prog3.cpp:37:4: error: expected unqualified-id before ‘if’
if ((mm 0)) <
^
prog3.cpp:42:4: error: expected unqualified-id before ‘if’
if ((ss 0)) <
^
prog3.cpp:47:1: error: expected declaration before ‘>’ token
>
^

You have extra braces.

You will find it extremely helpful to
1. Indent your code consistently. Use an editor which does this for you.
2. Type the closing brace at the same type you type the opening brace. Use an editor which does this for you.

Here is a «fixed» version. (there’s still some issues, but it will compile with warnings.)

i run your program but then i see this issue it will be helpful if i get perfectly running program so that i know for my upcoming exam how to make this type of program run. I am currently preparing for my exam. hope to see some help from you guys out there

In function ‘int main()’:
9:26: error: expected ‘)’ before ‘h’
9:33: warning: format ‘%d’ expects a matching ‘int’ argument [-Wformat=]
In function ‘bool readTime(int&, int&, int&)’:
41:1: warning: control reaches end of non-void function [-Wreturn-type]

This line :
printf( «%2d:%2d:%2d» h, m, s);

Should be :
printf( «%2d:%2d:%2d» , h, m, s); // An extra comma (,)

thank you for the help but why am i facing problem like this?

progs3.cpp:41:1: warning: control reaches end of non-void function [-Wreturn-type]
>
^

Notice that the compiler provides you with the location of any errors that it encounters.

Line 9, column 26 — usually there’s a filename, too. There’s a missing comma (I missed it, apologies.)

If the problem is a syntax error, the compiler will report the error no earlier than it appears. Look at the location of the first error and then look backwards towards the beginning of the file until you find it.

thank you for the help its so much appreciated and helpful for my upcoming exam and future programming errors. but can you help me with my issue on line 41?

Источник

  • Forum
  • Beginners
  • Expected initializer before ‘.’ token

Expected initializer before ‘.’ token

I’m writing a class with an array and I’m supposed to calculate the average of some entered grades outside the class and in the main but I get the error
Expected Initializer before ‘.’ token

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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
 #include <iostream>

using std::cout;
using std::cin;
using std::endl;

class Student{
    private:
    float grades[10];

    public:
    void setGrades()
    {
        float grades[10];
        int i;
        for(i = 0; i < 10; i++)
        {
            cout << "Enter Grade # " << i + 1 << endl;
            cin >> grades[i];
            cout << endl;
        }
    }

    float getGrade ()
    {
        int i;

        cout << "Grades" << endl;;

        for(i = 0; i < 10; i++)
        {
            cout << "  " << grades[i] << endl;
        }
    }

};

int main () {
    Student gradeAverage;
    float grades = 0.0;

    gradeAverage.setGrades();

    float gradeAverage.getGrade();
    float computeAverage = 0;

    for(int i = 0; i < 5; i++)
    {
        computeAverage = computeAverage + gradeAverage.getGrade();
    }

    cout << computeAverage/5 << endl;

    return 0;
}

I’m not to sure what to do or i even did the class right
Please help!

A compiler says more than just: «error». It also mentions line of code.
For example:

 In member function 'float Student::getGrade()':
34:5: warning: no return statement in function returning non-void [-Wreturn-type]

 In function 'int main()':
44:23: error: expected initializer before '.' token
40:11: warning: unused variable 'grades' [-Wunused-variable]

Two warnings.

What if I promised you $1000, but then just walk away, leaving you empty handed?
You make a promise on line 24, but you don’t keep it.

The error is on line 44. Please explain this code:
float gradeAverage.getGrade();

Yeah sorry i forgot to put where i had the error.
I understand what you mean by that analogy but I don’t understand what’s a fix for it in the code.
And this was a mistake i didn’t mean to type that
float gradeAverage.getGrade();

If the problem is

, what do you think the solution might be?

Hello Brandon17,

Line 44 looks like a nice prototype, but what is it doing in the middle of the program?

In the function «getGrade()» Why are you printing the array when you should be returning something from the array. In this case the «getGrade()» function should have a parameter the represents the element of the array that you need.

As you have it «float getGrade ()» would be better named «void printGrades ()».

Hope that helps,

Andy

I know that i shouldn’t be printing the there but the question was my teacher gave me was this
Write a class called Student that contains a property called grades that can store a
maximum of 10 grades. Create a setter and a getter method. The setter method
will take no parameters and return no parameters. Instead, within the setter
method you must construct a loop that will ask the user to enter 10 grades. The
getter method will simply print the 10 grades; so, it will take no and return no
parameters. Yes, that is a misnomer; this is because passing and returning arrays
has not been covered yet. Create another method called computeAverage that
return the average of all the grades. Create another method called
minimumGrade that returns the minimum grade the student received.

He knows it’s a misnomer but he wants us to do it anyway.
He hasn’t covered it yet so I was just looking it up but nothing I find helps

Hello Brandon17,

Now that I see what is required I will take a look tomorrow and see what I can do.

Andy

The following cannot be compiled.
float gradeAverage.getGrade();

To resolve compilation error, change to
grades=gradeAverage.getGrade();
or simply remove «float» as follows
gradeAverage.getGrade();

Last edited on

you have some issues to resolve here,

i think you should rename setGrades() and getGrades() to inputGrades() and outputGrades() so the names match the functionality better, you are calling getGrade() expecting to get a grade but thats not what the function does, and it does not return a grade at all, its name has misled you. If your tutor did not tell you what to call the functions then rename them to be more meaningful and because it does not return a value it should be «void».

you have not added a function computeAverage() that your tutor asked for. Let it calculate the average from the grades array and return it. because it will return a float value, it should be declared as float computeAverage().

1
2
3
4
    Student student;
    student.setGrades();  // assign the grades
    student.getGrades();  // list the grades
    cout << student.computeAverage() << endl;  // output the average 

Last edited on

Hello Brandon17,

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Write a class called Student that contains a property called grades that can store a maximum of 10 grades.

Create a setter and a getter method.

The setter method will take no parameters and return no parameters. Instead, within the setter method you must construct
a loop that will ask the user to enter 10 grades.

The getter method will simply print the 10 grades; so, it will take no and return no parameters.

Yes, that is a misnomer; this is because passing and returning arrays has not been covered yet.

Create another method called computeAverage that return the average of all the grades.

Create another method called minimumGrade that returns the minimum grade the student received.

He knows it's a misnomer but he wants us to do it anyway. 

In lines 5 and 8 it says will take no parameters and return no parameters yet the get function is trying to return a float, but it should return nothing.

Now you need to create two functions «computeAverage» and » minimumGrade» and both do return a value.

Give it a try and see what you can come up with. We can always fix what is wrong.

Hope that helps,

Andy

Hello Brandon17,

I reworked the «set» function to speed up testing. I looks like this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
void setGrades()  // <--- Should be renamed.
{
	double gradesArr[MAXSIZE]{ 85, 89, 77, 100, 95, 91, 87, 97, 93, 87 };  // <--- Added for testing. Comment out when finished.
	int i;

	for (i = 0; i < MAXSIZE; i++)
	{
		//cout << "Enter Grade # " << i + 1 << ": ";  // <--- Changed. Removed the "endl". Puts input on same line as prompt.
		//cin >> grades[i];
		grades[i] = gradesArr[i];  // <--- Added for testing.
		//cout << endl;  // <--- Commented for testing.
	}

	std::cout << std::endl;  // <--- Used for testing.
}

This way the array in the class is loaded with the same numbers each time the program is run. It helps in seeing how other functions work because you are using the same numbers each time and you do not have to enter ten numbers each time the program runs. Once working you can change back to getting the user input.

Just a little trick to cut down on testing time.

Hope that helps,

Andy

Topic archived. No new replies allowed.

You forgot a ; in line 4 of your code dude! (In the image you posted.)

Actually there is no need of line 4: int lsearch(int [], int, int). Because in the next line you are defining the function itself. You can skip the prototype declaration if you wish.

And from next time please post proper code, not just an image. And by code I mean actual code that is causing error. Here the code in your image is different from the one which you have typed in your post!

In your typed code you are calling lsearch as lsearch(arr[], N, ITEM) [line 34]. A call should be made like this: lsearch(arr, N, ITEM).

Here is you corrected code:

#include <iostream>
using namespace std;

int lsearch(int [], int, int);

int main() {
    int N, ITEM, INDEX, ar[20];
    cout << "How many elements? (max 20): " << endl;
    cin >> N;
    cout << "Enter elements: " << endl;
    for (int i = 0; i < N; i++)
        cin >> ar[i];
    cout << "Your array is as follows: " << endl;
    for (int i = 0; i < N; i++)
        cout << ar[i] << endl;
    cout << "Enter the element to be searched for: " << endl;
    cin >> ITEM;
    INDEX = lsearch(ar, N, ITEM);
    if (INDEX == -1)
        cout << "Element not found!" << endl;
    else
        cout << "Item found at index: " << INDEX << " position: " << INDEX + 1 << endl;
    return 0;
}

int lsearch(int ar[], int N, int ITEM) {
    for (int i = 0; i < N; i++)
        if (ar[i] == ITEM)
            return i;
    return -1;
}

Sample Run:

How many elements? (max 20): 5
Enter elements: 1 2 3 4 5
Your array is as follows: 
1
2
3
4
5
Enter the element to be searched for: 4
Item found at index: 3 position: 4

This code is practically the same (I guessed this code from your image):

#include <iostream>
using namespace std;

int lsearch(int[], int, int); // Your line 4 which isn't necessary and where you missed a semi-colon!
int lsearch(int ar[], int N, int ITEM) {
    for (int i = 0; i < N; i++)
        if (ar[i] == ITEM)
            return i;
    return -1;
}

int main() {
    // same as in above code
}

You should also check out this thread on why «using namespace std» is considered a bad practice.

  1. Я пишу пустой код, безо всего, выделяет слово void и выдаёт такую ошибку:

    Arduino: 1.6.8 (Windows 7), Плата:»Arduino/Genuino Uno»

    sketch_may03a:7: error: expected initializer before ‘void’

    E:СашаАрдуйноsketch_may03asketch_may03a.ino: In function ‘void setup()’:

    sketch_may03a:5: error: expected ‘;’ before ‘}’ token

    E:СашаАрдуйноsketch_may03asketch_may03a.ino: In function ‘void loop()’:

    sketch_may03a:10: error: expected ‘;’ before ‘}’ token

    exit status 1
    expected initializer before ‘void’

    Что делать? Скачал программу с официального сайта.

  2. внимательно читать сообщение об ошибке: в функции setup() в строках 5 и 10 отсутствует символ «;» в конце строки.

  3. кто может помочь в этом??

    Вложения:

    • 2016-05-03 (1).png

  4. Не определен объект Audio. Скорее всего отсутствует библиотека или она не включена в программу.

  5. Arduino: 1.6.8 Hourly Build 2016/01/27 03:44 (Windows 10), Плата:»Arduino/Genuino Uno»

    sketch_oct31a:53: error: expected unqualified-id before ‘{‘ token

    sketch_oct31a:61: error: expected declaration before ‘}’ token

    exit status 1
    expected unqualified-id before ‘{‘ token

    This report would have more information with
    «Show verbose output during compilation»
    option enabled in File -> Preferences.

    Помогите! Обьясните что делать?

  6. C:UsersUserDesktoparduino-nightlyhardwarearduinoavrcoresarduino/main.cpp:43: undefined reference to `setup’

    collect2.exe: error: ld returned 1 exit status

    exit status 1
    Ошибка компиляции для платы Arduino/Genuino Uno.
    Что за ошибка?

При попытке написать этот код я получаю сообщение об ошибке "cin doesnt name a type",
Я не знаю, в чем конкретно проблема, и я попытался написать «используя пространство имен std;», но он выдал ту же ошибку.

Вот код

#include<iostream>

namespace myStuff {

int value = 0;

}

using namespace myStuff;

int main {

std::cout << "enter integer " << ;
std::cin >> value;
std::cout << "nyouhaveenterd a value" << value ;

return 0;

}

Вот ошибка компиляции:

: extended initializer lists only available with `-std=c++0x` or `-std=gnu++0x` [enabled by default]|
: expected primary-expression before ‘;’ token|
expected `}` before `;` token|
`cin` does not name a type|
: `cout` does not name a type|
: expected unqualified-id before `return`|
: expected declaration before `}` token|
||=== Build finished: 6 errors, 1 warnings ===|

1

Решение

int main{

должно быть

int main(){

а также

std::cout << "enter integer " << ;

должно быть

std::cout << "enter integer ";

7

Другие решения

На этой линии:

std::cout << "enter integer " << ;

Там нет соответствующего операнда, чтобы сделать утверждение синтаксически допустимым. Это, вероятно, источник ваших ошибок.

1

Это предыдущая строка.

 cout<<"enter integer" **<<** ;

что в прошлом << ожидает аргумент, который никогда не приводится

0

Понравилась статья? Поделить с друзьями:
  • Error expected identifier or before string constant
  • Error expected identifier or before numeric constant
  • Error execution failed with error code 1
  • Error expected for function style cast or type construction
  • Error expected expression before token что это