Click here to Skip to main content
15,867,141 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
QuestionTo find the angle of turn in a car racing game in C++/SFML Pin
Tarun Jha21-Jul-18 23:39
Tarun Jha21-Jul-18 23:39 
AnswerRe: To find the angle of turn in a car racing game in C++/SFML Pin
John Schroedl23-Jul-18 6:41
professionalJohn Schroedl23-Jul-18 6:41 
GeneralRe: To find the angle of turn in a car racing game in C++/SFML Pin
Tarun Jha25-Jul-18 7:36
Tarun Jha25-Jul-18 7:36 
QuestionSmall RAII-like cleanup class in C++/CLI Pin
John Schroedl15-Jun-18 9:08
professionalJohn Schroedl15-Jun-18 9:08 
QuestionInformation Edit Source code for c++ Pin
Member 1165875229-May-18 19:48
Member 1165875229-May-18 19:48 
AnswerRe: Information Edit Source code for c++ Pin
Richard MacCutchan29-May-18 21:05
mveRichard MacCutchan29-May-18 21:05 
AnswerRe: Information Edit Source code for c++ Pin
Jochen Arndt30-May-18 2:55
professionalJochen Arndt30-May-18 2:55 
QuestionError On a Project I'm Working On. (Sorry If Not descriptive enough, 1st time) Pin
CyberFaggot9-May-18 15:53
CyberFaggot9-May-18 15:53 
Hi so this is my first post here, I'm having the following problem

----------------------------------------------------------------------------------------------------
6 11 E:\Trabalhos\Programação\Projeto\Projeto.cpp [Error] expected constructor, destructor, or type conversion before '(' token
----------------------------------------------------------------------------------------------------

Here's the code:

#include <iostream>
#include <fstream>
#include <locale.h>
using namespace std;

setlocale (LC_ALL, "Portuguese");

ofstream ficheiro ("Info Trabalhador");

int x, i,a,b,d;
	
int esc[4] = {100, 150, 200, 250}; 

struct trab
{
	char nome[100];
	char morada[200];
	int numero;
	int telefone;
};

trab f;

int salario(int n1,int  n2){
	int money;
	money = n1*n2;
	return money;
}

void menu1 (){
	cout<<" * * * * * * * * * * * * * * * * * * * *"<<endl;
	cout<<" * 1. - Identificação                  *"<<endl;
	cout<<" * 2. - Escalão Do Trabalhor           *"<<endl;
	cout<<" * 3. - Número De Horas Trabalhadas    *"<<endl;
	cout<<" * 4. - Salvar Ficheiro                *"<<endl;
	cout<<" * 5. - Sair                           *"<<endl;
	cout<<" * * * * * * * * * * * * * * * * * * * *"<<endl;
}

	

int main (){
	
	menu:
	menu1();
	cout<<endl;
	cout<<"R: ";
	cin>>x;
	cout<<endl;
	
switch (x)
{
	case 1:
	        cout<<"Qual o seu nome?"<<endl<<endl;
		cout<<"R: ";
		cin>>f.nome;
		cout<<endl;
		cout<<"Qual a sua morada?"<<endl<<endl;
		cout<<"R: ";
		cin>>f.morada;
		cout<<endl;
		cout<<"Qual o seu número?"<<endl<<endl;
		cout<<"R: ";
		cin>>f.numero;
		cout<<endl;
		cout<<"Qual o seu telemóvel?"<<endl<<endl;
		cout<<"R: ";
		cin>>f.telefone;
		cout<<endl;
		system("pause");
		system("cls");
		goto menu;
		break;

	
	case 2:
		for (i=0; i<=4; i++)
{
			cout<<i+1 <<". "<<esc[i]<<" euros/horas"<<endl;
			cout<<endl;
}
			cout<<"R: ";
			cin>>a;
			cout<<endl;
			system ("Pause");
			system ("cls");
			goto menu;
		
	case 3:
			cout<<"Quantas horas trabalhou?"<<endl;
			cout<<"R: ";
			cin>>b;
		if (a == 1)
{
			d=100;
			cout<<"Deve Receber: "<<salario(d,b)<<endl<<endl;
			system ("Pause");
			system ("cls");
			goto menu;
}

		 else if (a == 2)
{
			d=150;
			cout<<"Deve Receber: "<<salario(d,b)<<endl<<endl;
			system ("Pause");
			system ("cls");
			goto menu;
}

		else if (a==3)
{			
			d=200;
			cout<<"Deve Receber: "<<salario(d,b)<<endl<<endl;
			system ("Pause");
			system ("cls");
			goto menu;
}
		else
			
			d=250;
			cout<<"Deve Receber: "<<salario(d,b)<<endl<<endl;
			system ("Pause");
			system ("cls");
			goto menu;
			break;
    
	case 4:
		if(ficheiro.is_open())
{
			ficheiro<<"Nome: "<<f.nome<<endl;
			ficheiro<<"Morada: "<<f.morada<<endl;
			ficheiro<<"Número: "<<f.numero<<endl;
			ficheiro<<"Telemóvel: "<<f.telefone<<endl;
			break;
}	
	case 5:
		return 0;
		break;
}
	system ("Pause");
	return 0;
}


Thanks for your help.
AnswerRe: Error On a Project I'm Working On. (Sorry If Not descriptive enough, 1st time) Pin
Richard MacCutchan11-May-18 21:19
mveRichard MacCutchan11-May-18 21:19 
QuestionPrint causes in afxtls.cpp Pin
Erich Ruth19-Apr-18 5:37
Erich Ruth19-Apr-18 5:37 
AnswerRe: Print causes in afxtls.cpp Pin
Richard Andrew x6413-May-18 7:22
professionalRichard Andrew x6413-May-18 7:22 
QuestionWhat is the alternative of _kbhit_ in linux ? Pin
Tarun Jha16-Apr-18 4:04
Tarun Jha16-Apr-18 4:04 
AnswerRe: What is the alternative of _kbhit_ in linux ? Pin
Maria Okta25-Jul-18 19:23
professionalMaria Okta25-Jul-18 19:23 
QuestionMore Than One Operator "+" Matches These Operands Pin
Paramu197313-Apr-18 5:26
Paramu197313-Apr-18 5:26 
QuestionRe: More Than One Operator "+" Matches These Operands Pin
Richard MacCutchan13-Apr-18 5:51
mveRichard MacCutchan13-Apr-18 5:51 
AnswerRe: More Than One Operator "+" Matches These Operands Pin
Paramu197313-Apr-18 6:05
Paramu197313-Apr-18 6:05 
GeneralRe: More Than One Operator "+" Matches These Operands Pin
Richard MacCutchan13-Apr-18 6:40
mveRichard MacCutchan13-Apr-18 6:40 
GeneralRe: More Than One Operator "+" Matches These Operands Pin
Paramu197313-Apr-18 14:18
Paramu197313-Apr-18 14:18 
QuestionHow to access the ref class declared DataTable ? Pin
Paramu197311-Apr-18 21:10
Paramu197311-Apr-18 21:10 
SuggestionRe: How to access the ref class declared DataTable ? Pin
Richard MacCutchan11-Apr-18 22:53
mveRichard MacCutchan11-Apr-18 22:53 
GeneralRe: How to access the ref class declared DataTable ? Pin
Paramu197312-Apr-18 1:42
Paramu197312-Apr-18 1:42 
GeneralRe: How to access the ref class declared DataTable ? Pin
Richard MacCutchan12-Apr-18 2:26
mveRichard MacCutchan12-Apr-18 2:26 
GeneralRe: How to access the ref class declared DataTable ? Pin
Paramu197312-Apr-18 7:50
Paramu197312-Apr-18 7:50 
QuestionString class using dynamic memory allocation Pin
Member 137677597-Apr-18 12:12
Member 137677597-Apr-18 12:12 
QuestionRe: String class using dynamic memory allocation Pin
Richard MacCutchan7-Apr-18 21:04
mveRichard MacCutchan7-Apr-18 21:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.