|
Xopecc 33 / 28 / 9 Регистрация: 13.09.2013 Сообщений: 250 |
||||
|
1 |
||||
|
13.09.2013, 07:57. Показов 5195. Ответов 12 Метки нет (Все метки)
Делаю простенький калькулятор, на 1 действие. Использую операторы If-Else. Использую Microsoft Visual Studio 2012. Пожалуйста, помогите найти ошибку!
__________________
0 |
|
alsav22 5493 / 4888 / 831 Регистрация: 04.06.2011 Сообщений: 13,587 |
||||
|
13.09.2013, 08:11 |
2 |
|||
1 |
|
39 / 39 / 8 Регистрация: 03.05.2013 Сообщений: 178 |
|
|
13.09.2013, 08:12 |
3 |
|
36 строка скопку закрой
0 |
|
Xopecc 33 / 28 / 9 Регистрация: 13.09.2013 Сообщений: 250 |
||||
|
13.09.2013, 08:13 [ТС] |
4 |
|||
|
Так где была ошибка?
0 |
|
5493 / 4888 / 831 Регистрация: 04.06.2011 Сообщений: 13,587 |
|
|
13.09.2013, 08:15 |
5 |
|
Так где была ошибка? Скобки не хватало где-то…
0 |
|
Winorun 39 / 39 / 8 Регистрация: 03.05.2013 Сообщений: 178 |
||||
|
13.09.2013, 08:15 |
6 |
|||
|
мой ответ к первому варианту ты после if вторую закрывающуюся скобку зыбываешь причем везде
1 |
|
33 / 28 / 9 Регистрация: 13.09.2013 Сообщений: 250 |
|
|
13.09.2013, 08:17 [ТС] |
7 |
|
Скобки не хватало где-то… То есть можно было не использовать Else?
0 |
|
39 / 39 / 8 Регистрация: 03.05.2013 Сообщений: 178 |
|
|
13.09.2013, 08:20 |
8 |
|
блин ты открыл елсе открыл иф а скобку забыл используй case Добавлено через 27 секунд
0 |
|
33 / 28 / 9 Регистрация: 13.09.2013 Сообщений: 250 |
|
|
13.09.2013, 08:21 [ТС] |
9 |
|
блин ты открыл елсе открыл иф а скобку забыл используй case Добавлено через 27 секунд через case не интересно
0 |
|
39 / 39 / 8 Регистрация: 03.05.2013 Сообщений: 178 |
|
|
13.09.2013, 08:22 |
10 |
|
ну так закрой скобку после else и будет тебе счастье
0 |
|
5493 / 4888 / 831 Регистрация: 04.06.2011 Сообщений: 13,587 |
|
|
13.09.2013, 08:22 |
11 |
|
То есть можно было не использовать Else? Смысла нет в else. Можно case, чтобы избежать лишних проверок в if.
0 |
|
39 / 39 / 8 Регистрация: 03.05.2013 Сообщений: 178 |
|
|
13.09.2013, 08:25 |
12 |
|
согласуй количество открывающихся фигурных скобок с закрывающимися
0 |
|
alsav22 5493 / 4888 / 831 Регистрация: 04.06.2011 Сообщений: 13,587 |
||||
|
13.09.2013, 08:29 |
13 |
|||
|
через case не интересно Тоже самое, что case, только без case:
0 |
|
IT_Exp Эксперт 87844 / 49110 / 22898 Регистрация: 17.06.2006 Сообщений: 92,604 |
13.09.2013, 08:29 |
|
13 |
could someone also tell me if the actions i am attempting to do which are stated in the comments are correct or not. i am new at c++ and i think its correct but i have doubts
#include<iostream>
#include<fstream>
#include<cstdlib>
#include<iomanip>
using namespace std;
int main()
{
ifstream in_stream; // reads itemlist.txt
ofstream out_stream1; // writes in items.txt
ifstream in_stream2; // reads pricelist.txt
ofstream out_stream3;// writes in plist.txt
ifstream in_stream4;// read recipt.txt
ofstream out_stream5;// write display.txt
float price=' ',curr_total=0.0;
int wrong=0;
int itemnum=' ';
char next;
in_stream.open("ITEMLIST.txt", ios::in); // list of avaliable items
if( in_stream.fail() )// check to see if itemlist.txt is open
{
wrong++;
cout << " the error occured here0, you have " << wrong++ << " errors" << endl;
cout << "Error opening the filen" << endl;
exit(1);
}
else{
cout << " System ran correctly " << endl;
out_stream1.open("listWititems.txt", ios::out); // list of avaliable items
if(out_stream1.fail() )// check to see if itemlist.txt is open
{
wrong++;
cout << " the error occured here1, you have " << wrong++ << " errors" << endl;
cout << "Error opening the filen";
exit(1);
}
else{
cout << " System ran correctly " << endl;
}
in_stream2.open("PRICELIST.txt", ios::in);
if( in_stream2.fail() )
{
wrong++;
cout << " the error occured here2, you have " << wrong++ << " errors" << endl;
cout << "Error opening the filen";
exit (1);
}
else{
cout << " System ran correctly " << endl;
}
out_stream3.open("listWitdollars.txt", ios::out);
if(out_stream3.fail() )
{
wrong++;
cout << " the error occured here3, you have " << wrong++ << " errors" << endl;
cout << "Error opening the filen";
exit (1);
}
else{
cout << " System ran correctly " << endl;
}
in_stream4.open("display.txt", ios::in);
if( in_stream4.fail() )
{
wrong++;
cout << " the error occured here4, you have " << wrong++ << " errors" << endl;
cout << "Error opening the filen";
exit (1);
}
else{
cout << " System ran correctly " << endl;
}
out_stream5.open("showitems.txt", ios::out);
if( out_stream5.fail() )
{
wrong++;
cout << " the error occured here5, you have " << wrong++ << " errors" << endl;
cout << "Error opening the filen";
exit (1);
}
else{
cout << " System ran correctly " << endl;
}
in_stream.close(); // closing files.
out_stream1.close();
in_stream2.close();
out_stream3.close();
in_stream4.close();
out_stream5.close();
system("pause");
in_stream.setf(ios::fixed);
while(in_stream.eof())
{
in_stream >> itemnum;
cin.clear();
cin >> next;
}
out_stream1.setf(ios::fixed);
while (out_stream1.eof())
{
out_stream1 << itemnum;
cin.clear();
cin >> next;
}
in_stream2.setf(ios::fixed);
in_stream2.setf(ios::showpoint);
in_stream2.precision(2);
while((price== (price*1.00)) && (itemnum == (itemnum*1)))
{
while (in_stream2 >> itemnum >> price) // gets itemnum and price
{
while (in_stream2.eof()) // reads file to end of file
{
in_stream2 >> itemnum;
in_stream2 >> price;
price++;
curr_total= price++;
in_stream2 >> curr_total;
cin.clear(); // allows more reading
cin >> next;
}
}
}
out_stream3.setf(ios::fixed);
out_stream3.setf(ios::showpoint);
out_stream3.precision(2);
while((price== (price*1.00)) && (itemnum == (itemnum*1)))
{
while (out_stream3 << itemnum << price)
{
while (out_stream3.eof()) // reads file to end of file
{
out_stream3 << itemnum;
out_stream3 << price;
price++;
curr_total= price++;
out_stream3 << curr_total;
cin.clear(); // allows more reading
cin >> next;
}
return itemnum, price;
}
}
in_stream4.setf(ios::fixed);
in_stream4.setf(ios::showpoint);
in_stream4.precision(2);
while ( in_stream4.eof())
{
in_stream4 >> itemnum >> price >> curr_total;
cin.clear();
cin >> next;
}
out_stream5.setf(ios::fixed);
out_stream5.setf(ios::showpoint);
out_stream5.precision(2);
out_stream5 <<setw(5)<< " itemnum " <<setw(5)<<" price "<<setw(5)<<" curr_total " <<endl; // sends items and prices to receipt.txt
out_stream5 << setw(5) << itemnum << setw(5) <<price << setw(5)<< curr_total; // sends items and prices to receipt.txt
out_stream5 << " You have a total of " << wrong++ << " errors " << endl;
}
could someone also tell me if the actions i am attempting to do which are stated in the comments are correct or not. i am new at c++ and i think its correct but i have doubts
#include<iostream>
#include<fstream>
#include<cstdlib>
#include<iomanip>
using namespace std;
int main()
{
ifstream in_stream; // reads itemlist.txt
ofstream out_stream1; // writes in items.txt
ifstream in_stream2; // reads pricelist.txt
ofstream out_stream3;// writes in plist.txt
ifstream in_stream4;// read recipt.txt
ofstream out_stream5;// write display.txt
float price=' ',curr_total=0.0;
int wrong=0;
int itemnum=' ';
char next;
in_stream.open("ITEMLIST.txt", ios::in); // list of avaliable items
if( in_stream.fail() )// check to see if itemlist.txt is open
{
wrong++;
cout << " the error occured here0, you have " << wrong++ << " errors" << endl;
cout << "Error opening the filen" << endl;
exit(1);
}
else{
cout << " System ran correctly " << endl;
out_stream1.open("listWititems.txt", ios::out); // list of avaliable items
if(out_stream1.fail() )// check to see if itemlist.txt is open
{
wrong++;
cout << " the error occured here1, you have " << wrong++ << " errors" << endl;
cout << "Error opening the filen";
exit(1);
}
else{
cout << " System ran correctly " << endl;
}
in_stream2.open("PRICELIST.txt", ios::in);
if( in_stream2.fail() )
{
wrong++;
cout << " the error occured here2, you have " << wrong++ << " errors" << endl;
cout << "Error opening the filen";
exit (1);
}
else{
cout << " System ran correctly " << endl;
}
out_stream3.open("listWitdollars.txt", ios::out);
if(out_stream3.fail() )
{
wrong++;
cout << " the error occured here3, you have " << wrong++ << " errors" << endl;
cout << "Error opening the filen";
exit (1);
}
else{
cout << " System ran correctly " << endl;
}
in_stream4.open("display.txt", ios::in);
if( in_stream4.fail() )
{
wrong++;
cout << " the error occured here4, you have " << wrong++ << " errors" << endl;
cout << "Error opening the filen";
exit (1);
}
else{
cout << " System ran correctly " << endl;
}
out_stream5.open("showitems.txt", ios::out);
if( out_stream5.fail() )
{
wrong++;
cout << " the error occured here5, you have " << wrong++ << " errors" << endl;
cout << "Error opening the filen";
exit (1);
}
else{
cout << " System ran correctly " << endl;
}
in_stream.close(); // closing files.
out_stream1.close();
in_stream2.close();
out_stream3.close();
in_stream4.close();
out_stream5.close();
system("pause");
in_stream.setf(ios::fixed);
while(in_stream.eof())
{
in_stream >> itemnum;
cin.clear();
cin >> next;
}
out_stream1.setf(ios::fixed);
while (out_stream1.eof())
{
out_stream1 << itemnum;
cin.clear();
cin >> next;
}
in_stream2.setf(ios::fixed);
in_stream2.setf(ios::showpoint);
in_stream2.precision(2);
while((price== (price*1.00)) && (itemnum == (itemnum*1)))
{
while (in_stream2 >> itemnum >> price) // gets itemnum and price
{
while (in_stream2.eof()) // reads file to end of file
{
in_stream2 >> itemnum;
in_stream2 >> price;
price++;
curr_total= price++;
in_stream2 >> curr_total;
cin.clear(); // allows more reading
cin >> next;
}
}
}
out_stream3.setf(ios::fixed);
out_stream3.setf(ios::showpoint);
out_stream3.precision(2);
while((price== (price*1.00)) && (itemnum == (itemnum*1)))
{
while (out_stream3 << itemnum << price)
{
while (out_stream3.eof()) // reads file to end of file
{
out_stream3 << itemnum;
out_stream3 << price;
price++;
curr_total= price++;
out_stream3 << curr_total;
cin.clear(); // allows more reading
cin >> next;
}
return itemnum, price;
}
}
in_stream4.setf(ios::fixed);
in_stream4.setf(ios::showpoint);
in_stream4.precision(2);
while ( in_stream4.eof())
{
in_stream4 >> itemnum >> price >> curr_total;
cin.clear();
cin >> next;
}
out_stream5.setf(ios::fixed);
out_stream5.setf(ios::showpoint);
out_stream5.precision(2);
out_stream5 <<setw(5)<< " itemnum " <<setw(5)<<" price "<<setw(5)<<" curr_total " <<endl; // sends items and prices to receipt.txt
out_stream5 << setw(5) << itemnum << setw(5) <<price << setw(5)<< curr_total; // sends items and prices to receipt.txt
out_stream5 << " You have a total of " << wrong++ << " errors " << endl;
}
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <string.h>
#include <iostream>
#include <cstdlib>
using namespace std;
#include "bcio2.h"
int error, x;
char totalimpulse[80], averageimpulse[80], ejection[50], emptymass[50], enginemass[50], fuelmass[50];
char launch[50];
void validate_number();
int main(void)
{
clrscr();
do{
printf("nTotal Impulse delivered: ");
gets(totalimpulse);
validate_number();
} while (error != 0);
do{
printf("nAverage Impulse delivered: ");
gets(averageimpulse);
validate_number();
} while (error != 0);
do{
printf("nTime that ejection charge fires: ");
gets(ejection);
validate_number();
} while (error != 0);
do{
printf("nThe mass of the empty vehicle: ");
gets(emptymass);
validate_number();
} while (error != 0);
do{
printf("nThe mass of the engine: ");
gets(enginemass);
validate_number();
} while (error != 0);
do{
printf("nThe mass of fuel: ");
gets(fuelmass);
validate_number();
} while (error != 0);
printf("nRocket parameters entered: n");
printf("nTotal Impulse delivered: %sn", totalimpulse);
printf("Average Impulse delivered: %sn", averageimpulse);
printf("Time that ejection charge fires: %sn", ejection);
printf("The mass of the empty vehicle: %sgn", emptymass);
printf("The mass of the engine: %sgn", enginemass);
printf("The mass of fuel: %sgn", fuelmass);
char ans;
do
{
cout<< "nLaunch simulation? (Y/N) : n";
cout<< "You must type a 'Y' or an 'N'.n";
cin >> ans;
}
while((ans !='Y')&&(ans !='N')&&(ans !='y')&&(ans !='n'));
if (ans == 'N')
{
getchar();
return 0;
}
else if (ans == 'Y')
{
// do something, calculations display page
return 0;
}
}
/************ Test all input in range 0 to 9 ****************/
void validate_number()
{
int errange = 0, numonly = 0, errlength = 0;
/********* validate numbers ********/
error = 0;
for (x = 0; x<strlen(totalimpulse); x++){
if (totalimpulse[x] >= '0' && totalimpulse[x] <= '9'); else{
numonly++;
error++;
}
for (x = 0; x<strlen(averageimpulse); x++){
if (averageimpulse[x] >= '0' && averageimpulse[x] <= '9'); else{
numonly++;
error++;
}
for (x = 0; x<strlen(ejection); x++){
if (ejection[x] >= '0' && ejection[x] <= '9'); else{
numonly++;
error++;
}
for (x = 0; x<strlen(emptymass); x++){
if (emptymass[x] >= '0' && emptymass[x] <= '9'); else{
numonly++;
error++;
}
for (x = 0; x<strlen(enginemass); x++){
if (enginemass[x] >= '0' && enginemass[x] <= '9'); else{
numonly++;
error++;
}
for (x = 0; x<strlen(fuelmass); x++){
if (fuelmass[x] >= '0' && fuelmass[x] <= '9'); else{
numonly++;
error++;
}
}
/********* validate range ********/
if (strlen(totalimpulse) <= 3){
x = atoi(totalimpulse);
if (x >= 0 && x <= 256)
;
else{
errange++;
error++;
}
}
else{
errlength++;
error++;
}
/**************** Report errors ******************/
if (error != 0){
if (numonly>0)
printf("nOnly values in the range 0 to 9 are valid ");
if (errange>0)
printf("nValue must be in the range 0 to 255");
if (errlength>0)
printf("nMore than three values were entered");
}
I’ve counted 21 open braces and 21 closed braces which all seem to be positioned correctly yet I’m still getting the error, anything a fresh pair of eyes can help me with? I’ve counted the brackets so many times over that I’m going crazy.
It’s a basic error for a basic problem but I’m just clueless as to what to change or add.
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <string.h>
#include <iostream>
#include <cstdlib>
using namespace std;
#include "bcio2.h"
int error, x;
char totalimpulse[80], averageimpulse[80], ejection[50], emptymass[50], enginemass[50], fuelmass[50];
char launch[50];
void validate_number();
int main(void)
{
clrscr();
do{
printf("nTotal Impulse delivered: ");
gets(totalimpulse);
validate_number();
} while (error != 0);
do{
printf("nAverage Impulse delivered: ");
gets(averageimpulse);
validate_number();
} while (error != 0);
do{
printf("nTime that ejection charge fires: ");
gets(ejection);
validate_number();
} while (error != 0);
do{
printf("nThe mass of the empty vehicle: ");
gets(emptymass);
validate_number();
} while (error != 0);
do{
printf("nThe mass of the engine: ");
gets(enginemass);
validate_number();
} while (error != 0);
do{
printf("nThe mass of fuel: ");
gets(fuelmass);
validate_number();
} while (error != 0);
printf("nRocket parameters entered: n");
printf("nTotal Impulse delivered: %sn", totalimpulse);
printf("Average Impulse delivered: %sn", averageimpulse);
printf("Time that ejection charge fires: %sn", ejection);
printf("The mass of the empty vehicle: %sgn", emptymass);
printf("The mass of the engine: %sgn", enginemass);
printf("The mass of fuel: %sgn", fuelmass);
char ans;
do
{
cout<< "nLaunch simulation? (Y/N) : n";
cout<< "You must type a 'Y' or an 'N'.n";
cin >> ans;
}
while((ans !='Y')&&(ans !='N')&&(ans !='y')&&(ans !='n'));
if (ans == 'N')
{
getchar();
return 0;
}
else if (ans == 'Y')
{
// do something, calculations display page
return 0;
}
}
/************ Test all input in range 0 to 9 ****************/
void validate_number()
{
int errange = 0, numonly = 0, errlength = 0;
/********* validate numbers ********/
error = 0;
for (x = 0; x<strlen(totalimpulse); x++){
if (totalimpulse[x] >= '0' && totalimpulse[x] <= '9'); else{
numonly++;
error++;
}
for (x = 0; x<strlen(averageimpulse); x++){
if (averageimpulse[x] >= '0' && averageimpulse[x] <= '9'); else{
numonly++;
error++;
}
for (x = 0; x<strlen(ejection); x++){
if (ejection[x] >= '0' && ejection[x] <= '9'); else{
numonly++;
error++;
}
for (x = 0; x<strlen(emptymass); x++){
if (emptymass[x] >= '0' && emptymass[x] <= '9'); else{
numonly++;
error++;
}
for (x = 0; x<strlen(enginemass); x++){
if (enginemass[x] >= '0' && enginemass[x] <= '9'); else{
numonly++;
error++;
}
for (x = 0; x<strlen(fuelmass); x++){
if (fuelmass[x] >= '0' && fuelmass[x] <= '9'); else{
numonly++;
error++;
}
}
/********* validate range ********/
if (strlen(totalimpulse) <= 3){
x = atoi(totalimpulse);
if (x >= 0 && x <= 256)
;
else{
errange++;
error++;
}
}
else{
errlength++;
error++;
}
/**************** Report errors ******************/
if (error != 0){
if (numonly>0)
printf("nOnly values in the range 0 to 9 are valid ");
if (errange>0)
printf("nValue must be in the range 0 to 255");
if (errlength>0)
printf("nMore than three values were entered");
}
I’ve counted 21 open braces and 21 closed braces which all seem to be positioned correctly yet I’m still getting the error, anything a fresh pair of eyes can help me with? I’ve counted the brackets so many times over that I’m going crazy.
It’s a basic error for a basic problem but I’m just clueless as to what to change or add.
Содержание
- fatal error C1075: end of file found before the left brace ‘<‘ at ‘c:documents and s
- All 21 Replies
- Fatal error c1075 no matching token found
- Fatal error C1075: «<«: не найдена несоответствующая лексема
- Ошибка компилятора C2672
- Пример
- Fatal error c1075 no matching token found
fatal error C1075: end of file found before the left brace ‘<‘ at ‘c:documents and s
Hi everyone I need help with something
i get this error
and i get the error around here
somewhere in there It gives me the error of
if anyone knows what im missing and where it is post a reply because this is the only error I have and I would like to get it fixed
- 12 Contributors 21 Replies 7K Views 7 Years Discussion Span Latest Post 7 Years Ago Latest Post by kuroshmokhtari
isn’t it obvious what your program is missing? There error message said it all — the < and >do not match. I can’t tell you which one is missing because you didn’t post all the code.
What part of the error message are you having difficulty comprehending?
>>OK THIS IS THE ENTIRE THING, HOPE SOMEONE CAN SEE WHAT IM MISSING
Just look at the last line of the code you posted. The code isn’t all there because the last function is …
Thanks for the help ill see if it helps and ill contact you if it dusnt when ur online
ANYONE ELSE READING THIS FEEL FREE TO GIVE ME YOUR RESPONSES FROM YOUR OPINION
As others have said, the error is clear, though it can be time-consuming to track down. …
Another way I have used to find missing braces is to comment out large blocks of code until the error goes away. You can narrow down the problem that way.
isn’t it obvious what your program is missing? There error message said it all — the < and >do not match. I can’t tell you which one is missing because you didn’t post all the code.
Hi everyone I need help with something
i get this error
and i get the error around here
somewhere in there It gives me the error of
if anyone knows what im missing and where it is post a reply because this is the only error I have and I would like to get it fixed
OK THIS IS THE ENTIRE THING, HOPE SOMEONE CAN SEE WHAT IM MISSING
Please tell me if you can help me solve this error and the error again is
What part of the error message are you having difficulty comprehending?
I’m specifically having problems somewhere around the text above and this is the error
Accoding to this im missing a brace or i put one extra but i tried and i cant find out, if anyone can find the error please comment me and tell me
You will have count the braces. For each < there must be a matching >.
>>OK THIS IS THE ENTIRE THING, HOPE SOMEONE CAN SEE WHAT IM MISSING
Just look at the last line of the code you posted. The code isn’t all there because the last function is not complete.
And please use code tags the next time you dump all that code here. Here is how to do it.
[code=cplusplus] // your code goes here
Also please read this thread.
Thanks for the help ill see if it helps and ill contact you if it dusnt when ur online
ANYONE ELSE READING THIS FEEL FREE TO GIVE ME YOUR RESPONSES FROM YOUR OPINION
Thanks for the help ill see if it helps and ill contact you if it dusnt when ur online
ANYONE ELSE READING THIS FEEL FREE TO GIVE ME YOUR RESPONSES FROM YOUR OPINION
As others have said, the error is clear, though it can be time-consuming to track down. You have a brackets problem. Somewhere there is a starting < with no matching ending >. Your job is to find it. Constant code indentation is critical for this. I personally prefer to use this type of formatting:
rather than this type:
since I find brackets matching easier using the first way. There are also many good IDEs like NetBeans and Visual Studio where you can minimize and expand bracket sections quickly by clicking the + and — signs next to the brackets. If you have a very short function and expanding the function makes it 100 lines long, chances are that’s your problem. The method is kind of trial and error and methodical noting of starting and ending brackets line numbers on a piece of paper till you find an extra bracket or a missing bracket. You can also quickly comment out and put back in large chunks of code sometimes, but mostly it’s plain old boring brackets counting.
Источник
Fatal error c1075 no matching token found
I’m trying to compile a CHUMP program and keep getting this error message
I read other forums talking about this error and I can’t seem to put my finger on what I’m doing wrong. I click on the error link and all it does is it brings me to the .cpp file. It does not direct me to an area in visual studio on where the issue may be. I look at the brackets and compare them to other programs and everything seems fine.
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
///
/// Summary for Form1
///
public ref class Form1 : public System::Windows::Forms::Form
<
public:
Form1(void)
<
InitializeComponent();
//
//TODO: Add the constructor code here
//
>
protected:
///
/// Clean up any resources being used.
///
Form1()
<
if (components)
<
delete components;
>
>
private: System::Windows::Forms::Button^ btnCreate;
protected:
protected:
private: System::Windows::Forms::TextBox^ txtItems;
private: System::Windows::Forms::TextBox^ txtLog;
private: System::Windows::Forms::Label^ label1;
private: System::Windows::Forms::Label^ label2;
private:
///
/// Required designer variable.
///
System::ComponentModel::Container ^components;
#pragma region Windows Form Designer generated code
///
/// Required method for Designer support — do not modify
/// the contents of this method with the code editor.
///
void InitializeComponent(void)
<
this->btnCreate = (gcnew System::Windows::Forms::Button());
this->txtItems = (gcnew System::Windows::Forms::TextBox());
this->txtLog = (gcnew System::Windows::Forms::TextBox());
this->label1 = (gcnew System::Windows::Forms::Label());
this->label2 = (gcnew System::Windows::Forms::Label());
this->SuspendLayout();
//
// btnCreate
//
this->btnCreate->Location = System::Drawing::Point(317, 44);
this->btnCreate->Name = L»btnCreate»;
this->btnCreate->Size = System::Drawing::Size(112, 30);
this->btnCreate->TabIndex = 0;
this->btnCreate->Text = L»Create Log»;
this->btnCreate->UseVisualStyleBackColor = true;
this->btnCreate->Click += gcnew System::EventHandler(this, &Form1::btnCreate_Click);
//
// txtItems
//
this->txtItems->Font = (gcnew System::Drawing::Font(L»Microsoft Sans Serif», 14.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
static_cast (0)));
this->txtItems->Location = System::Drawing::Point(60, 50);
this->txtItems->Name = L»txtItems»;
this->txtItems->Size = System::Drawing::Size(110, 29);
this->txtItems->TabIndex = 1;
this->txtItems->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
//
// txtLog
//
this->txtLog->Location = System::Drawing::Point(60, 100);
this->txtLog->Multiline = true;
this->txtLog->Name = L»txtLog»;
this->txtLog->ScrollBars = System::Windows::Forms::ScrollBars::Vertical;
this->txtLog->Size = System::Drawing::Size(358, 450);
this->txtLog->TabIndex = 2;
//
// label1
//
this->label1->AutoSize = true;
this->label1->Location = System::Drawing::Point(57, 34);
this->label1->Name = L»label1″;
this->label1->Size = System::Drawing::Size(80, 13);
this->label1->TabIndex = 3;
this->label1->Text = L»Items produced»;
//
// label2
//
this->label2->AutoSize = true;
this->label2->Location = System::Drawing::Point(200, 84);
this->label2->Name = L»label2″;
this->label2->Size = System::Drawing::Size(75, 13);
this->label2->TabIndex = 4;
this->label2->Text = L»Production log»;
//
// Form1
//
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(484, 562);
this->Controls->Add(this->label2);
this->Controls->Add(this->label1);
this->Controls->Add(this->txtLog);
this->Controls->Add(this->txtItems);
this->Controls->Add(this->btnCreate);
this->Name = L»Form1″;
this->Text = L»CHUMP Quality Control Program»;
this->Load += gcnew System::EventHandler(this, &Form1::Form1_Load);
this->ResumeLayout(false);
this->PerformLayout();
>
#pragma endregion
//Instance variables
Random^ randomNumGen;
String^ strLog;
private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) <
DateTime now = DateTime::Now; // Used as seed value
randomNumGen = gcnew Random(now.Millisecond);
strLog = gcnew String(«ItemttThicknessrn»);
txtItems->Text = «100»;
>
private: System::Void btnCreate_Click(System::Object^ sender, System::EventArgs^ e) <
int items;
double thick;
Int32::TryParse(txtItems->Text, items);
for (int i = 0; i Next(0,1000) /100.0;
strLog += «CHUMP » + i + «:t» + thick + » mmrn»;
>
txtLog->Text = strLog;
>;
>
Источник
Fatal error C1075: «<«: не найдена несоответствующая лексема
ГДЕ ТУТ БЛЯТЬ ОШИБКА!?
void setup_main_menu()
<
static auto set_sub = [](int sub) -> void <
g_cfg.menu.group_sub = sub;
>;
static auto set_tabsub = [](int sub) -> void <
g_cfg.menu.tab_sub = sub;
>;
void setup_main_menu()
<
static auto set_sub = [](int sub)->void
<
g_cfg.menu.group_sub = sub;
>
>;
static auto set_tabsub = [](int sub) -> void
<
g_cfg.menu.tab_sub = sub;
>
>;
void setup_main_menu()
<
static auto set_sub = [](int sub)->void
<
g_cfg.menu.group_sub = sub;
>
>;
static auto set_tabsub = [](int sub) -> void
<
g_cfg.menu.tab_sub = sub;
>
>;
Проект предоставляет различный материал, относящийся к сфере киберспорта, программирования, ПО для игр, а также позволяет его участникам общаться на многие другие темы. Почта для жалоб: [email protected]
Источник
Ошибка компилятора C2672
«function«: соответствующая перегруженная функция не найдена
Компилятору не удалось найти перегруженную функцию, соответствующую указанной функции. Не найдена функция, которая принимает соответствующие параметры, или соответствующая функция не имеет необходимых специальных возможностей в контексте.
При использовании определенных стандартных контейнеров или алгоритмов библиотеки типы должны предоставлять доступные члены или дружественные функции, удовлетворяющие требованиям контейнера или алгоритма. Например, типы итератора должны быть производными от std::iterator<> . Для операций сравнения или использования других операторов в типах элементов контейнера может потребоваться, чтобы тип считался как левый, так и как правый операнд. Использование типа в качестве правого операнда может потребовать реализации оператора в качестве функции, не являющейся членом типа.
Пример
Версии компилятора до Visual Studio 2017 не выполняли проверку доступа к полным именам в некоторых контекстах шаблонов. Это может помешать ожидаемой работе SFINAE там, где подстановка должна завершиться ошибкой из-за отсутствия доступа к имени. Такая ситуация может приводить к сбою или неожиданному поведению во время выполнения из-за того, что компилятор неправильно вызывает неверную перегрузку оператора. В Visual Studio 2017 выводится ошибка компилятора.
Этот пример компилируется в Visual Studio 2015, но вызывает ошибку в Visual Studio 2017. Чтобы устранить эту проблему, сделайте элемент параметра шаблона доступным там, где он вычисляется.
Источник
Fatal error c1075 no matching token found
Бывалый
Профиль
Группа: Участник
Сообщений: 230
Регистрация: 9.4.2008
Репутация: нет
Всего: нет
как боротся с подобной ошибкой
| shuttle |
|
||
| Код |
| fatal error C1075: end of file found before the left brace ‘ <‘ at ‘путь до файла’ |
Создал Win32 -> Windows application ->empty project. Далее накидал код и вылезла подобная ошибка.
![]() |
![]() |
Шустрый
Профиль
Группа: Участник
Сообщений: 59
Регистрация: 3.5.2006
Репутация: нет
Всего: нет
| Zakary |
|
||
|
| Rickert |
|
||
Ситхи не пройдут! Профиль Репутация: нет |
|||
|
любитель
Профиль
Группа: Участник Клуба
Сообщений: 7954
Регистрация: 14.1.2006
Репутация: 79
Всего: 250
не старайтесь выдать явление наоборот, иначе в будущем такой подход в программировании сильно подпортит жизнь.
Не «символ после..» , а «конец файла до..» и эти формулировки не идентичны.
Это сообщение отредактировал(а) mes — 27.4.2009, 09:45



















| mes |
|
||
1. Публиковать ссылки на вскрытые компоненты
2. Обсуждать взлом компонентов и делиться вскрытыми компонентами
- Действия модераторов можно обсудить здесь
- С просьбами о написании курсовой, реферата и т.п. обращаться сюда
- Вопросы по реализации алгоритмов рассматриваются здесь
- FAQ раздела лежит здесь!
Если Вам понравилась атмосфера форума, заходите к нам чаще! С уважением, JackYF, bsa.
| Правила форума «C/C++: Для новичков» |
| 0 Пользователей читают эту тему (0 Гостей и 0 Скрытых Пользователей) |
| 0 Пользователей: |
| « Предыдущая тема | C/C++: Для новичков | Следующая тема » |
[ Время генерации скрипта: 0.1028 ] [ Использовано запросов: 21 ] [ GZIP включён ]
Источник
Adblock
detector
не могу найти ошибку в коде
Primary tabs
Forums:
вроде бы нормальный код, но при компиляции выдает ошибку.
ошибка выглядит так:
программа должна была считывать коэффициенты a, b, c и вычислять корни квадратного уравнения.
исходный код:
В ЧЕМ КОСЯК?! не могу разобраться.
Key Words for FKN + antitotal forum (CS VSU):
Sun, 10/07/2012 — 20:08
сначала избавься от этого =
сначала избавься от этого =
warning C4700: использована неинициализированная локальная перем
с этим точно не скомпилируется =
вообще там если два раза кликаешь на строчку уведомления — студия покажет строчку в который ошибка.
_________ _ _ ______
dthcbz фкн вгу and co
Sun, 10/07/2012 — 21:33
для начала надо бы
для начала надо бы отформатировать код —
отступ слева = два пробела для каждого логического включения)
_____________
матфак вгу и остальная классика =)
Sun, 10/07/2012 — 22:29
Надо поставить , как минимум
Надо поставить , как минимум закрывающую скобку для функции main. Да и чтобы компилятор не выдавал такого количества предупреждений и они просто не отбивали желания прочитать и разобраться, то не стоит делать так много преобразований типов — используйте везде double. Ведь эта прога не входит в состав супер требовательного продукта и экономить память на таких переменных не стоит. Да в и больших продуктах далеко не всегда оправданно.
Если после постановки скобки код не скомпилируется, то постарайтесь исправить такой объём преобразований типов и скинуть лог сборки заного.
Mon, 10/08/2012 — 22:57
господа, мне стыдно за мой
господа, мне стыдно за мой кривой исходный код, я посидел некоторое время и (не без посторонней помощи) исправил. вот рабочая версия:
(знаки большеменьше при указании библиотек вручную заменены на кавычки)
Wed, 10/10/2012 — 17:43
Для стандартных библиотек без
Для стандартных библиотек без разницы что использовать кавычки или знаки большеменьше. Просто знаки «» ищут в строго определённом месте модули, а вот с кавычками сложнее, там используется , если конкретный путь не указывается, то смотрится эта библиотека сначала в рабочей папке, потом на уровне выше и так далее.
Sat, 10/13/2012 — 12:02
фишка в том, что теперешний
фишка в том, что теперешний html-фильтр давит угловые скобки если они стоят вплотную к слову на английском.
потому рекомендую в коде просто добавлять пробелы.
если индустрия написания кода на си++ будет поставлена на поток — то тогда будем искать другое решение)
_____________
матфак вгу и остальная классика =)
Источник
фатальная ошибка C1075: перед левой фигурной скобкой обнаружен конец файла, а файлы чтения и записи не работают
Может ли кто-нибудь также сказать мне, правильны ли действия, которые я пытаюсь сделать, указанные в комментариях, или нет. Я новичок в C ++, и я думаю, что это правильно, но у меня есть сомнения
Это слишком много кода. Также нужно исправить отступ. Я подозреваю, что вам где-то действительно не хватает>, но это трудно сказать, потому что ваш код не имеет разумной структуры. — Billy ONeal
Это отличный пример того, почему так важны правильные отступы в вашем коде. — R Samuel Klatchko
3 ответы
Рискну предположить, что вам не хватает символа ‘>’ в первом блоке else.
Чтобы избежать подобных проблем в будущем, исправьте отступ (или позвольте AStyle или аналогичной программе исправить это за вас) и используйте редактор, который выделяет синтаксис (особенно блоки кода между фигурными скобками).
ответ дан 20 апр.
Я не понимаю, как исправить отступы. Я подумал, что это было сразу после проверки, чтобы убедиться, что файлы открыты. могу ли я открыть файл или указать имя файла, прежде чем я напишу код для конкретного файла. на моем я не указывал имя файла раньше — user320950
Я не говорю о логике вашего кода. Отступ = количество пробелов в начале каждой строки кода = то, как выглядит ваш код. Если вы используете последовательные, четкие правила отступов, очень легко обнаружить ошибки, такие как отсутствие скобки в блоке else (что вызывает ошибку компиляции в опубликованном вами коде). Проверять en.wikipedia.org/wiki/Indent_style для некоторых широко используемых стандартов отступов (я предпочитаю тот, который называется «вариант 1TBS»). На самом деле не имеет значения, какой из них вы выберете, если вы придерживаетесь его во всем написанном коде. — Chalup
Хорошо, спасибо, я вынул проверки ошибок, потому что они вызывали ошибки. Ты знаешь почему? — user320950
То, что вы только что написали, не имеет никакого смысла. Если вы хотите получить ответы, используйте правильную терминологию в своих вопросах. — Chalup
извините, под проверкой ошибок я подразумеваю: проверяет, правильно ли открылся файл — user320950
Источник











Загрузка .




